diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2023-02-06 23:44:31 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-02-06 15:30:42 -0800 |
commit | 4bd0785dc2eb7b3f23d25c8013337cc51ab1065d (patch) | |
tree | 212e0867573fcb4b7db80ebb649a046a9b80fab8 /t/t7402-submodule-rebase.sh | |
parent | c7e03b4e39d40b431764797d3a792169cd375705 (diff) | |
download | git-4bd0785dc2eb7b3f23d25c8013337cc51ab1065d.tar.gz |
tests: don't lose exit status with "test <op> $(git ...)"
As with the preceding commit, rewrite tests that ran "git" inside
command substitution and lost the exit status of "git" so that we
notice the failing "git". This time around we're converting cases that
didn't involve a containing sub-shell around the command substitution.
In the case of "t0060-path-utils.sh" and
"t2005-checkout-index-symlinks.sh" convert the relevant code to using
the modern style of indentation and newline wrapping while having to
change it.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7402-submodule-rebase.sh')
-rwxr-xr-x | t/t7402-submodule-rebase.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/t/t7402-submodule-rebase.sh b/t/t7402-submodule-rebase.sh index 1927a86283..c74798e8d2 100755 --- a/t/t7402-submodule-rebase.sh +++ b/t/t7402-submodule-rebase.sh @@ -55,12 +55,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' ' |