]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t4014: remove confusing pipe in check_threading()
authorDenton Liu <liu.denton@gmail.com>
Tue, 27 Aug 2019 04:05:12 +0000 (00:05 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 5 Sep 2019 19:58:52 +0000 (12:58 -0700)
In check_threading(), there was a Git command in the upstream of a pipe.
In order to not lose its status code, it was saved into a file. However,
this may be confusing so rewrite to redirect IO to file. This allows us
to directly use the conventional &&-chain.

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

index 18142ee5fac73e5b56b9e3e7e082369c14722ff6..67f4c62ed68e360761e0e6eb945e49ab9af597e6 100755 (executable)
@@ -319,7 +319,7 @@ test_expect_success 'reroll count (-v)' '
 check_threading () {
        expect="$1" &&
        shift &&
-       (git format-patch --stdout "$@"; echo $? >status.out) |
+       git format-patch --stdout "$@" >patch &&
        # Prints everything between the Message-ID and In-Reply-To,
        # and replaces all Message-ID-lookalikes by a sequence number
        perl -ne '
@@ -334,8 +334,7 @@ check_threading () {
                        print;
                }
                print "---\n" if /^From /i;
-       ' >actual &&
-       test 0 = "$(cat status.out)" &&
+       ' <patch >actual &&
        test_cmp "$expect" actual
 }