diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2023-02-06 22:44:31 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-02-06 23:30:42 (GMT) |
commit | 4bd0785dc2eb7b3f23d25c8013337cc51ab1065d (patch) | |
tree | 212e0867573fcb4b7db80ebb649a046a9b80fab8 /t/t0001-init.sh | |
parent | c7e03b4e39d40b431764797d3a792169cd375705 (diff) | |
download | git-4bd0785dc2eb7b3f23d25c8013337cc51ab1065d.zip git-4bd0785dc2eb7b3f23d25c8013337cc51ab1065d.tar.gz git-4bd0785dc2eb7b3f23d25c8013337cc51ab1065d.tar.bz2 |
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/t0001-init.sh')
-rwxr-xr-x | t/t0001-init.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/t/t0001-init.sh b/t/t0001-init.sh index d479303..30a6edc 100755 --- a/t/t0001-init.sh +++ b/t/t0001-init.sh @@ -598,9 +598,14 @@ test_expect_success 'invalid default branch name' ' test_expect_success 'branch -m with the initial branch' ' git init rename-initial && git -C rename-initial branch -m renamed && - test renamed = $(git -C rename-initial symbolic-ref --short HEAD) && + echo renamed >expect && + git -C rename-initial symbolic-ref --short HEAD >actual && + test_cmp expect actual && + git -C rename-initial branch -m renamed again && - test again = $(git -C rename-initial symbolic-ref --short HEAD) + echo again >expect && + git -C rename-initial symbolic-ref --short HEAD >actual && + test_cmp expect actual ' test_done |