aboutsummaryrefslogtreecommitdiffstats
path: root/t/lib-httpd.sh
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2023-02-06 23:44:30 +0100
committerJunio C Hamano <gitster@pobox.com>2023-02-06 15:30:41 -0800
commit0cd1a8818db35df70c88d7864682146bf4fa8227 (patch)
treeea5b5a54e19053d5a44f436452f6e607c4585e24 /t/lib-httpd.sh
parentt/lib-patch-mode.sh: fix ignored exit codes (diff)
downloadgit-0cd1a8818db35df70c88d7864682146bf4fa8227.tar.gz
git-0cd1a8818db35df70c88d7864682146bf4fa8227.zip
tests: don't lose exit status with "(cd ...; test <op> $(git ...))"
Rewrite tests that ran "git" inside command substitution and lost the exit status of "git" so that we notice the failing "git". Have them use modern patterns such as a "test_cmp" of the expected outputs instead. We'll fix more of these these in the subsequent commit, for now we're only converting the cases where this loss of exit code was combined with spawning a sub-shell. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/lib-httpd.sh')
-rw-r--r--t/lib-httpd.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index 608949ea80..b8b1d044e8 100644
--- a/t/lib-httpd.sh
+++ b/t/lib-httpd.sh
@@ -217,8 +217,12 @@ test_http_push_nonff () {
git commit -a -m path2 --amend &&
test_must_fail git push -v origin >output 2>&1 &&
- (cd "$REMOTE_REPO" &&
- test $HEAD = $(git rev-parse --verify HEAD))
+ (
+ cd "$REMOTE_REPO" &&
+ echo "$HEAD" >expect &&
+ git rev-parse --verify HEAD >actual &&
+ test_cmp expect actual
+ )
'
test_expect_success 'non-fast-forward push show ref status' '