Skip to content

Commit ef343f4

Browse files
Denton-Lgitster
authored andcommitted
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>
1 parent 3227ddc commit ef343f4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

t/t5512-ls-remote.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ test_expect_success setup '
2121
git tag mark1.1 &&
2222
git tag mark1.2 &&
2323
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 &&
2929
3030
git remote add self "$(pwd)/.git"
3131
'
@@ -185,8 +185,8 @@ do
185185
test_config $configsection.hiderefs refs/tags &&
186186
git ls-remote . >actual &&
187187
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 &&
190190
test_cmp expect actual
191191
'
192192

0 commit comments

Comments
 (0)