t7501: stop losing return codes of git commands
commit756ee7fc9fcf599e807a27e45a9d0fb89e8411a8
authorDenton Liu <liu.denton@gmail.com>
Wed, 27 Nov 2019 19:53:43 +0000 (27 11:53 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 29 Nov 2019 21:20:15 +0000 (29 13:20 -0800)
treea29768d89384af5ad2ded875a5bfe1eff8a46f70
parent38c1aa01de8220f84460ef115f1c1fc58b590240
t7501: stop losing return codes of git commands

In a pipe, only the return code of the last command is used. Thus, all
other commands will have their return codes masked. Rewrite pipes so
that there are no git commands upstream so that we will know if a
command fails.

In the 'interactive add' test case, we prepend a `test_must_fail` to
`git commit --interactive`. When there are no changes to commit,
`git commit` will exit with status code 1. Following along with the rest
of the file, we use `test_must_fail` to test for this case.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7501-commit-basic-functionality.sh