diff options
author | Pratik Karki <predatoramigo@gmail.com> | 2018-03-27 23:16:37 +0545 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-28 09:30:14 -0700 |
commit | a4d4e32a700df92ca576ce89110c075b8ce6da75 (patch) | |
tree | 4f991815ba071fc8849314f248018d1054a7ef99 /t/t9114-git-svn-dcommit-merge.sh | |
parent | Git 2.16.3 (diff) | |
download | tgif-a4d4e32a700df92ca576ce89110c075b8ce6da75.tar.xz |
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/t9114-git-svn-dcommit-merge.sh')
-rwxr-xr-x | t/t9114-git-svn-dcommit-merge.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh index 50bca62def..32317d6bca 100755 --- a/t/t9114-git-svn-dcommit-merge.sh +++ b/t/t9114-git-svn-dcommit-merge.sh @@ -68,7 +68,8 @@ test_debug 'gitk --all & sleep 1' test_expect_success 'verify pre-merge ancestry' " test x\$(git rev-parse --verify refs/heads/svn^2) = \ x\$(git rev-parse --verify refs/heads/merge) && - git cat-file commit refs/heads/svn^ | grep '^friend$' + git cat-file commit refs/heads/svn^ >actual && + grep '^friend$' actual " test_expect_success 'git svn dcommit merges' " @@ -82,12 +83,13 @@ test_expect_success 'verify post-merge ancestry' " x\$(git rev-parse --verify refs/remotes/origin/trunk) && test x\$(git rev-parse --verify refs/heads/svn^2) = \ x\$(git rev-parse --verify refs/heads/merge) && - git cat-file commit refs/heads/svn^ | grep '^friend$' + git cat-file commit refs/heads/svn^ >actual && + grep '^friend$' actual " test_expect_success 'verify merge commit message' " - git rev-list --pretty=raw -1 refs/heads/svn | \ - grep \" Merge branch 'merge' into svn\" + git rev-list --pretty=raw -1 refs/heads/svn >actual && + grep \" Merge branch 'merge' into svn\" actual " test_done |