aboutsummaryrefslogtreecommitdiff
path: root/t/t3701-add-interactive.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-03-19 15:03:10 -0700
committerJunio C Hamano <gitster@pobox.com>2023-03-19 15:03:10 -0700
commit6f54213718ccd05be8a07f74d0d4e524ebccb3be (patch)
tree92d0218f9b7f7d4eaa9ecf1c34ad1b6f1fa54777 /t/t3701-add-interactive.sh
parent950264636c68591989456e3ba0a5442f93152c1a (diff)
parent9fdc79ecba0f4a3ef885f1409d2db5a1dbabd649 (diff)
downloadgit-6f54213718ccd05be8a07f74d0d4e524ebccb3be.tar.xz
Merge branch 'ab/avoid-losing-exit-codes-in-tests'
Test clean-up. * ab/avoid-losing-exit-codes-in-tests: tests: don't lose misc "git" exit codes tests: don't lose exit status with "test <op> $(git ...)" tests: don't lose "git" exit codes in "! ( git ... | grep )" tests: don't lose exit status with "(cd ...; test <op> $(git ...))" t/lib-patch-mode.sh: fix ignored exit codes auto-crlf tests: don't lose exit code in loops and outside tests
Diffstat (limited to 't/t3701-add-interactive.sh')
-rwxr-xr-xt/t3701-add-interactive.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
index 3a99837d9b..032b61ce21 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -311,9 +311,11 @@ test_expect_success FILEMODE 'stage mode and hunk' '
echo content >>file &&
chmod +x file &&
printf "y\\ny\\n" | git add -p &&
- git diff --cached file | grep "new mode" &&
- git diff --cached file | grep "+content" &&
- test -z "$(git diff file)"
+ git diff --cached file >out &&
+ grep "new mode" out &&
+ grep "+content" out &&
+ git diff file >out &&
+ test_must_be_empty out
'
# end of tests disabled when filemode is not usable