]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t5520: don't put git in upstream of pipe
authorDenton Liu <liu.denton@gmail.com>
Tue, 12 Nov 2019 23:08:10 +0000 (15:08 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 21 Nov 2019 00:41:51 +0000 (09:41 +0900)
Before, if the invocation of git failed, it would be masked by the pipe
since only the return code of the last element of a pipe is used.
Rewrite the test to put the git command on its own line so its return
code is not masked.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5520-pull.sh

index 8b7e7ae55da0880a60737445170f5d6ad620a832..8ddf89e550eef3adf137958c82ef57b2fbedff43 100755 (executable)
@@ -668,7 +668,8 @@ test_expect_success 'pull --rebase fails on corrupt HEAD' '
        (
                cd corrupt &&
                test_commit one &&
-               obj=$(git rev-parse --verify HEAD | sed "s#^..#&/#") &&
+               git rev-parse --verify HEAD >head &&
+               obj=$(sed "s#^..#&/#" head) &&
                rm -f .git/objects/$obj &&
                test_must_fail git pull --rebase
        )