t2200,t9832: avoid using 'git' upstream in a pipe
Avoid placing `git` upstream in a pipe since doing so throws away its exit code, thus an unexpected failure may go unnoticed. Signed-off-by: Amanda Shafack <shafack.likhene@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Amanda Shafack committed
Oct 18, 2020 at 20:48 UTC
a90765bef5556512160b4c302eb7f9dde159130f
2 files changed
+4
-2
t/t2200-add-update.sh
+2
-1
index f764b7e3f5..7cb7a70382 100755
--- a/t/t2200-add-update.sh
+++ b/t/t2200-add-update.sh
@@ -179,7 +179,8 @@ test_expect_success 'add -u resolves unmerged paths' '
test_expect_success '"add -u non-existent" should fail' '
test_must_fail git add -u non-existent &&
- ! (git ls-files | grep "non-existent")
+ git ls-files >actual &&
+ ! grep "non-existent" actual
'
test_done
t/t9832-unshelve.sh
+2
-1
index 7194fb2855..6b3cb0414a 100755
--- a/t/t9832-unshelve.sh
+++ b/t/t9832-unshelve.sh
@@ -68,7 +68,8 @@ EOF
cd "$git" &&
change=$(last_shelved_change) &&
git p4 unshelve $change &&
- git show refs/remotes/p4-unshelved/$change | grep -q "Further description" &&
+ git show refs/remotes/p4-unshelved/$change >actual &&
+ grep -q "Further description" actual &&
git cherry-pick refs/remotes/p4-unshelved/$change &&
test_path_is_file file2 &&
test_cmp file1 "$cli"/file1 &&