summaryrefslogtreecommitdiff
path: root/t/t5512-ls-remote.sh
diff options
context:
space:
mode:
authorDenton Liu <liu.denton@gmail.com>2020-03-26 04:27:50 -0400
committerJunio C Hamano <gitster@pobox.com>2020-03-27 10:56:40 -0700
commitef343f41239f63ac20ebe7909756c7d57c5416dd (patch)
tree72d5959299765239f73441db40a9d81b85a46411 /t/t5512-ls-remote.sh
parent3227ddc97f7e268488791161a88760dbdaf4e6a9 (diff)
downloadgit-ef343f41239f63ac20ebe7909756c7d57c5416dd.tar.gz
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>
Diffstat (limited to 't/t5512-ls-remote.sh')
-rwxr-xr-xt/t5512-ls-remote.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh
index 98de7f5933..e98c3a0174 100755
--- a/t/t5512-ls-remote.sh
+++ b/t/t5512-ls-remote.sh
@@ -21,11 +21,11 @@ test_expect_success setup '
git tag mark1.1 &&
git tag mark1.2 &&
git tag mark1.10 &&
- git show-ref --tags -d | sed -e "s/ / /" >expected.tag &&
- (
- echo "$(git rev-parse HEAD) HEAD" &&
- git show-ref -d | sed -e "s/ / /"
- ) >expected.all &&
+ git show-ref --tags -d >expected.tag.raw &&
+ sed -e "s/ / /" expected.tag.raw >expected.tag &&
+ generate_references HEAD >expected.all &&
+ git show-ref -d >refs &&
+ sed -e "s/ / /" refs >>expected.all &&
git remote add self "$(pwd)/.git"
'
@@ -185,8 +185,8 @@ do
test_config $configsection.hiderefs refs/tags &&
git ls-remote . >actual &&
test_unconfig $configsection.hiderefs &&
- git ls-remote . |
- sed -e "/ refs\/tags\//d" >expect &&
+ git ls-remote . >expect.raw &&
+ sed -e "/ refs\/tags\//d" expect.raw >expect &&
test_cmp expect actual
'