From 8fb268720e8565885039e7491f4628974e2d66a2 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Fri, 20 Mar 2015 06:06:15 -0400 Subject: t: fix severe &&-chain breakage These are tests which are missing a link in their &&-chain, in a location which causes a significant portion of the test to be missed (e.g., the test effectively does nothing, or consists of a long string of actions and output comparisons, and we throw away the exit code of at least one part of the string). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 938fc8b..bc0b392 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -677,7 +677,7 @@ test_expect_success 'invalid unit' ' echo 1auto >expect && git config aninvalid.unit >actual && test_cmp expect actual && - cat >expect <<-\EOF + cat >expect <<-\EOF && fatal: bad numeric config value '\''1auto'\'' for '\''aninvalid.unit'\'' in .git/config: invalid unit EOF test_must_fail git config --int --get aninvalid.unit 2>actual && diff --git a/t/t1403-show-ref.sh b/t/t1403-show-ref.sh index 3e500ed..7e10bcf 100755 --- a/t/t1403-show-ref.sh +++ b/t/t1403-show-ref.sh @@ -28,7 +28,7 @@ test_expect_success 'show-ref' ' >expect && - test_must_fail git show-ref D >actual + test_must_fail git show-ref D >actual && test_cmp expect actual ' @@ -62,7 +62,7 @@ test_expect_success 'show-ref --verify' ' test_must_fail git show-ref --verify tags/A >actual && test_cmp expect actual && - test_must_fail git show-ref --verify D >actual + test_must_fail git show-ref --verify D >actual && test_cmp expect actual ' @@ -78,7 +78,7 @@ test_expect_success 'show-ref --verify -q' ' test_must_fail git show-ref --verify -q tags/A >actual && test_cmp expect actual && - test_must_fail git show-ref --verify -q D >actual + test_must_fail git show-ref --verify -q D >actual && test_cmp expect actual ' @@ -105,10 +105,10 @@ test_expect_success 'show-ref -d' ' test_cmp expect actual && git show-ref -d refs/heads/master >actual && - test_cmp expect actual + test_cmp expect actual && git show-ref -d --verify refs/heads/master >actual && - test_cmp expect actual + test_cmp expect actual && >expect && diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh index 94fb473..a55f5bc 100755 --- a/t/t1700-split-index.sh +++ b/t/t1700-split-index.sh @@ -182,7 +182,7 @@ test_expect_success 'unify index, two files remain' ' 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 one 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 two EOF - test_cmp ls-files.expect ls-files.actual + test_cmp ls-files.expect ls-files.actual && test-dump-split-index .git/index | sed "/^own/d" >actual && cat >expect <actual_diff_dirstat_M && test_cmp expect_diff_dirstat_M actual_diff_dirstat_M && git diff --dirstat=files,10,cumulative,changes,noncumulative,3 -C -C HEAD^..HEAD >actual_diff_dirstat_CC && - test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC + test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC && git diff --dirstat=files --dirstat=10 --dirstat=cumulative --dirstat=changes --dirstat=noncumulative -X3 HEAD^..HEAD >actual_diff_dirstat && test_cmp expect_diff_dirstat actual_diff_dirstat && git diff --dirstat=files --dirstat=10 --dirstat=cumulative --dirstat=changes --dirstat=noncumulative -X3 -M HEAD^..HEAD >actual_diff_dirstat_M && diff --git a/t/t4104-apply-boundary.sh b/t/t4104-apply-boundary.sh index c617c2a..c97aad1 100755 --- a/t/t4104-apply-boundary.sh +++ b/t/t4104-apply-boundary.sh @@ -78,8 +78,8 @@ test_expect_success setup ' echo $i done >victim && cat victim >del-z-expect && - git diff victim >del-z-patch.with - git diff --unified=0 >del-z-patch.without && + git diff victim >del-z-patch.with && + git diff --unified=0 >del-z-patch.without : done ' diff --git a/t/t4202-log.sh b/t/t4202-log.sh index 5f2b290..a22ac7c 100755 --- a/t/t4202-log.sh +++ b/t/t4202-log.sh @@ -481,7 +481,7 @@ test_expect_success 'log.decorate configuration' ' git log --oneline --no-decorate >actual && test_cmp expect.none actual && git log --oneline --decorate >actual && - test_cmp expect.short actual + test_cmp expect.short actual && test_unconfig log.decorate && git log --pretty=raw >expect.raw && diff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh index 60df10f..e97cfb2 100755 --- a/t/t5100-mailinfo.sh +++ b/t/t5100-mailinfo.sh @@ -34,7 +34,7 @@ do if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers then check_mailinfo $mail --no-inbody-headers - fi + fi && if test -f "$TEST_DIRECTORY"/t5100/msg$mail--message-id then check_mailinfo $mail --message-id diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index d78f320..d3fa2c9 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -124,7 +124,7 @@ test_expect_success 'fetch --prune handles overlapping refspecs' ' git rev-parse origin/master && git rev-parse origin/pr/42 && - git config --unset-all remote.origin.fetch + git config --unset-all remote.origin.fetch && git config remote.origin.fetch refs/pull/*/head:refs/remotes/origin/pr/* && git config --add remote.origin.fetch refs/heads/*:refs/remotes/origin/* && diff --git a/t/t5540-http-push-webdav.sh b/t/t5540-http-push-webdav.sh index 8d7b3c5..88ff5a4 100755 --- a/t/t5540-http-push-webdav.sh +++ b/t/t5540-http-push-webdav.sh @@ -169,7 +169,7 @@ test_expect_failure 'push to password-protected repository (no user in URL)' ' test_commit pw-nouser && set_askpass user@host pass@host && git push "$HTTPD_URL/auth/dumb/test_repo.git" HEAD && - expect_askpass both user@host + expect_askpass both user@host && git rev-parse --verify HEAD >expect && git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH/auth/dumb/test_repo.git" \ rev-parse --verify HEAD >actual && diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh index 6cbc12d..eae20d9 100755 --- a/t/t5551-http-fetch-smart.sh +++ b/t/t5551-http-fetch-smart.sh @@ -169,7 +169,7 @@ test_expect_success 'GIT_SMART_HTTP can disable smart http' ' ' test_expect_success 'invalid Content-Type rejected' ' - test_must_fail git clone $HTTPD_URL/broken_smart/repo.git 2>actual + test_must_fail git clone $HTTPD_URL/broken_smart/repo.git 2>actual && grep "not valid:" actual ' diff --git a/t/t6036-recursive-corner-cases.sh b/t/t6036-recursive-corner-cases.sh index a86087b..b43d031 100755 --- a/t/t6036-recursive-corner-cases.sh +++ b/t/t6036-recursive-corner-cases.sh @@ -533,7 +533,7 @@ test_expect_success 'merge of E2 & D fails but has appropriate contents' ' test $(git rev-parse :3:a) = $(git rev-parse B:a) && test $(git rev-parse :2:a/file) = $(git rev-parse E2:a/file) && - test $(git rev-parse :1:a/file) = $(git rev-parse C:a/file) + test $(git rev-parse :1:a/file) = $(git rev-parse C:a/file) && test $(git rev-parse :0:ignore-me) = $(git rev-parse A:ignore-me) && test -f a~D^0 diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index c538e0a..6bd5a00 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -2228,7 +2228,7 @@ test_expect_success 'R: feature import-marks-if-exists' ' >expect && git fast-import --import-marks-if-exists=not_io.marks \ - --export-marks=io.marks <<-\EOF + --export-marks=io.marks <<-\EOF && feature import-marks-if-exists=io.marks EOF test_cmp expect io.marks diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 7a883d1..4a14a58 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -568,7 +568,7 @@ test_expect_success 'complete files' ' test_completion "git commit " "modified" && : TODO .gitignore should not be here && - test_completion "git ls-files " <<-\EOF + test_completion "git ls-files " <<-\EOF && .gitignore dir modified -- cgit v0.10.2-6-g49f6