summaryrefslogtreecommitdiff
path: root/t/t9109-git-svn-multi-glob.sh
diff options
context:
space:
mode:
authorPratik Karki <predatoramigo@gmail.com>2018-03-27 17:31:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-03-28 16:30:14 (GMT)
commita4d4e32a700df92ca576ce89110c075b8ce6da75 (patch)
tree4f991815ba071fc8849314f248018d1054a7ef99 /t/t9109-git-svn-multi-glob.sh
parentd32eb83c1db7d0a8bb54fe743c6d1dd674d372c5 (diff)
downloadgit-a4d4e32a700df92ca576ce89110c075b8ce6da75.zip
git-a4d4e32a700df92ca576ce89110c075b8ce6da75.tar.gz
git-a4d4e32a700df92ca576ce89110c075b8ce6da75.tar.bz2
test: avoid pipes in git related commands for test
Avoid using pipes downstream of Git commands since the exit codes of commands upstream of pipes get swallowed, thus potentially hiding failure of those commands. Instead, capture Git command output to a file and apply the downstream command(s) to that file. Signed-off-by: Pratik Karki <predatoramigo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9109-git-svn-multi-glob.sh')
-rwxr-xr-xt/t9109-git-svn-multi-glob.sh24
1 files changed, 14 insertions, 10 deletions
diff --git a/t/t9109-git-svn-multi-glob.sh b/t/t9109-git-svn-multi-glob.sh
index 8d99e84..c1e7542 100755
--- a/t/t9109-git-svn-multi-glob.sh
+++ b/t/t9109-git-svn-multi-glob.sh
@@ -47,8 +47,8 @@ test_expect_success 'test refspec globbing' '
git config --add svn-remote.svn.tags\
"tags/*/src/a:refs/remotes/tags/*" &&
git svn multi-fetch &&
- git log --pretty=oneline refs/remotes/tags/end | \
- sed -e "s/^.\{41\}//" > output.end &&
+ git log --pretty=oneline refs/remotes/tags/end >actual &&
+ sed -e "s/^.\{41\}//" actual >output.end &&
test_cmp expect.end output.end &&
test "$(git rev-parse refs/remotes/tags/end~1)" = \
"$(git rev-parse refs/remotes/branches/v1/start)" &&
@@ -75,14 +75,16 @@ test_expect_success 'test left-hand-side only globbing' '
svn_cmd commit -m "try to try"
) &&
git svn fetch two &&
- test $(git rev-list refs/remotes/two/tags/end | wc -l) -eq 6 &&
- test $(git rev-list refs/remotes/two/branches/v1/start | wc -l) -eq 3 &&
+ git rev-list refs/remotes/two/tags/end >actual &&
+ test_line_count = 6 actual &&
+ git rev-list refs/remotes/two/branches/v1/start >actual &&
+ test_line_count = 3 actual &&
test $(git rev-parse refs/remotes/two/branches/v1/start~2) = \
$(git rev-parse refs/remotes/two/trunk) &&
test $(git rev-parse refs/remotes/two/tags/end~3) = \
$(git rev-parse refs/remotes/two/branches/v1/start) &&
- git log --pretty=oneline refs/remotes/two/tags/end | \
- sed -e "s/^.\{41\}//" > output.two &&
+ git log --pretty=oneline refs/remotes/two/tags/end >actual &&
+ sed -e "s/^.\{41\}//" actual >output.two &&
test_cmp expect.two output.two
'
cat > expect.four <<EOF
@@ -124,14 +126,16 @@ test_expect_success 'test another branch' '
git config --add svn-remote.four.tags \
"tags/*:refs/remotes/four/tags/*" &&
git svn fetch four &&
- test $(git rev-list refs/remotes/four/tags/next | wc -l) -eq 5 &&
- test $(git rev-list refs/remotes/four/branches/v2/start | wc -l) -eq 3 &&
+ git rev-list refs/remotes/four/tags/next >actual &&
+ test_line_count = 5 actual &&
+ git rev-list refs/remotes/four/branches/v2/start >actual &&
+ test_line_count = 3 actual &&
test $(git rev-parse refs/remotes/four/branches/v2/start~2) = \
$(git rev-parse refs/remotes/four/trunk) &&
test $(git rev-parse refs/remotes/four/tags/next~2) = \
$(git rev-parse refs/remotes/four/branches/v2/start) &&
- git log --pretty=oneline refs/remotes/four/tags/next | \
- sed -e "s/^.\{41\}//" > output.four &&
+ git log --pretty=oneline refs/remotes/four/tags/next >actual &&
+ sed -e "s/^.\{41\}//" actual >output.four &&
test_cmp expect.four output.four
'