@matheusbsbs / matheus-bagliano / commits / ef343f4123
Fork 0

t5512: 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 their failure is reported. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Denton Liu committed Mar 26, 2020 at 04:27 UTC ef343f41239f63ac20ebe7909756c7d57c5416dd
1 file changed +7 -7
t/t5512-ls-remote.sh
+7 -7
@@ -21,11 +21,11 @@ test_expect_success setup '
21 git tag mark1.1 &&
22 git tag mark1.2 &&
23 git tag mark1.10 &&
24 - git show-ref --tags -d | sed -e "s/ / /" >expected.tag &&
25 - (
26 - echo "$(git rev-parse HEAD) HEAD" &&
27 - git show-ref -d | sed -e "s/ / /"
28 - ) >expected.all &&
24 + git show-ref --tags -d >expected.tag.raw &&
25 + sed -e "s/ / /" expected.tag.raw >expected.tag &&
26 + generate_references HEAD >expected.all &&
27 + git show-ref -d >refs &&
28 + sed -e "s/ / /" refs >>expected.all &&
29
30 git remote add self "$(pwd)/.git"
31 '
@@ -185,8 +185,8 @@ do
185 test_config $configsection.hiderefs refs/tags &&
186 git ls-remote . >actual &&
187 test_unconfig $configsection.hiderefs &&
188 - git ls-remote . |
189 - sed -e "/ refs\/tags\//d" >expect &&
188 + git ls-remote . >expect.raw &&
189 + sed -e "/ refs\/tags\//d" expect.raw >expect &&
190 test_cmp expect actual
191 '
192