From 4bd0785dc2eb7b3f23d25c8013337cc51ab1065d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Mon, 6 Feb 2023 23:44:31 +0100 Subject: tests: don't lose exit status with "test $(git ...)" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- t/t2005-checkout-index-symlinks.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 't/t2005-checkout-index-symlinks.sh') diff --git a/t/t2005-checkout-index-symlinks.sh b/t/t2005-checkout-index-symlinks.sh index 112682a45a..67d18cfa10 100755 --- a/t/t2005-checkout-index-symlinks.sh +++ b/t/t2005-checkout-index-symlinks.sh @@ -22,8 +22,10 @@ test_expect_success \ git checkout-index symlink && test -f symlink' -test_expect_success \ -'the file must be the blob we added during the setup' ' -test "$(git hash-object -t blob symlink)" = $l' +test_expect_success 'the file must be the blob we added during the setup' ' + echo "$l" >expect && + git hash-object -t blob symlink >actual && + test_cmp expect actual +' test_done -- cgit v1.2.3