diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-03-19 15:03:10 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-03-19 15:03:10 -0700 |
commit | 6f54213718ccd05be8a07f74d0d4e524ebccb3be (patch) | |
tree | 92d0218f9b7f7d4eaa9ecf1c34ad1b6f1fa54777 /t/t7402-submodule-rebase.sh | |
parent | 950264636c68591989456e3ba0a5442f93152c1a (diff) | |
parent | 9fdc79ecba0f4a3ef885f1409d2db5a1dbabd649 (diff) | |
download | git-6f54213718ccd05be8a07f74d0d4e524ebccb3be.tar.gz |
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/t7402-submodule-rebase.sh')
-rwxr-xr-x | t/t7402-submodule-rebase.sh | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/t/t7402-submodule-rebase.sh b/t/t7402-submodule-rebase.sh index b19792b326..2b3c363078 100755 --- a/t/t7402-submodule-rebase.sh +++ b/t/t7402-submodule-rebase.sh @@ -56,12 +56,15 @@ chmod a+x fake-editor.sh test_expect_success 'interactive rebase with a dirty submodule' ' - test submodule = $(git diff --name-only) && + echo submodule >expect && + git diff --name-only >actual && + test_cmp expect actual && HEAD=$(git rev-parse HEAD) && GIT_EDITOR="\"$(pwd)/fake-editor.sh\"" EDITOR_TEXT="pick $HEAD" \ git rebase -i HEAD^ && - test submodule = $(git diff --name-only) - + echo submodule >expect && + git diff --name-only >actual && + test_cmp expect actual ' test_expect_success 'rebase with dirty file and submodule fails' ' @@ -83,11 +86,19 @@ test_expect_success 'stash with a dirty submodule' ' CURRENT=$(cd submodule && git rev-parse HEAD) && git stash && test new != $(cat file) && - test submodule = $(git diff --name-only) && - test $CURRENT = $(cd submodule && git rev-parse HEAD) && + echo submodule >expect && + git diff --name-only >actual && + test_cmp expect actual && + + echo "$CURRENT" >expect && + git -C submodule rev-parse HEAD >actual && + test_cmp expect actual && + git stash apply && test new = $(cat file) && - test $CURRENT = $(cd submodule && git rev-parse HEAD) + echo "$CURRENT" >expect && + git -C submodule rev-parse HEAD >actual && + test_cmp expect actual ' |