summaryrefslogtreecommitdiff
path: root/t/t5504-fetch-receive-strict.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-08-03 18:01:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-08-03 18:01:18 (GMT)
commitb2f44feba593ed0c4294a6f9933c8a1b6f190e04 (patch)
tree3b3d19bc7fd5883a4cdf6e0bbf8cf161a63eeab9 /t/t5504-fetch-receive-strict.sh
parentbe9cb560e31c76c00760dadb151b5e3059970586 (diff)
parent1335f732892601368876e0e41c9ea288c2ab18f3 (diff)
downloadgit-b2f44feba593ed0c4294a6f9933c8a1b6f190e04.zip
git-b2f44feba593ed0c4294a6f9933c8a1b6f190e04.tar.gz
git-b2f44feba593ed0c4294a6f9933c8a1b6f190e04.tar.bz2
Merge branch 'js/fsck-opt'
Allow ignoring fsck errors on specific set of known-to-be-bad objects, and also tweaking warning level of various kinds of non critical breakages reported. * js/fsck-opt: fsck: support ignoring objects in `git fsck` via fsck.skiplist fsck: git receive-pack: support excluding objects from fsck'ing fsck: introduce `git fsck --connectivity-only` fsck: support demoting errors to warnings fsck: document the new receive.fsck.<msg-id> options fsck: allow upgrading fsck warnings to errors fsck: optionally ignore specific fsck issues completely fsck: disallow demoting grave fsck errors to warnings fsck: add a simple test for receive.fsck.<msg-id> fsck: make fsck_tag() warn-friendly fsck: handle multiple authors in commits specially fsck: make fsck_commit() warn-friendly fsck: make fsck_ident() warn-friendly fsck: report the ID of the error/warning fsck (receive-pack): allow demoting errors to warnings fsck: offer a function to demote fsck errors to warnings fsck: provide a function to parse fsck message IDs fsck: introduce identifiers for fsck messages fsck: introduce fsck options
Diffstat (limited to 't/t5504-fetch-receive-strict.sh')
-rwxr-xr-xt/t5504-fetch-receive-strict.sh51
1 files changed, 51 insertions, 0 deletions
diff --git a/t/t5504-fetch-receive-strict.sh b/t/t5504-fetch-receive-strict.sh
index 69ee13c..44f3d5f 100755
--- a/t/t5504-fetch-receive-strict.sh
+++ b/t/t5504-fetch-receive-strict.sh
@@ -115,4 +115,55 @@ test_expect_success 'push with transfer.fsckobjects' '
test_cmp exp act
'
+cat >bogus-commit <<\EOF
+tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
+author Bugs Bunny 1234567890 +0000
+committer Bugs Bunny <bugs@bun.ni> 1234567890 +0000
+
+This commit object intentionally broken
+EOF
+
+test_expect_success 'push with receive.fsck.skipList' '
+ commit="$(git hash-object -t commit -w --stdin <bogus-commit)" &&
+ git push . $commit:refs/heads/bogus &&
+ rm -rf dst &&
+ git init dst &&
+ git --git-dir=dst/.git config receive.fsckObjects true &&
+ test_must_fail git push --porcelain dst bogus &&
+ git --git-dir=dst/.git config receive.fsck.skipList SKIP &&
+ echo $commit >dst/.git/SKIP &&
+ git push --porcelain dst bogus
+'
+
+test_expect_success 'push with receive.fsck.missingEmail=warn' '
+ commit="$(git hash-object -t commit -w --stdin <bogus-commit)" &&
+ git push . $commit:refs/heads/bogus &&
+ rm -rf dst &&
+ git init dst &&
+ git --git-dir=dst/.git config receive.fsckobjects true &&
+ test_must_fail git push --porcelain dst bogus &&
+ git --git-dir=dst/.git config \
+ receive.fsck.missingEmail warn &&
+ git push --porcelain dst bogus >act 2>&1 &&
+ grep "missingEmail" act &&
+ git --git-dir=dst/.git branch -D bogus &&
+ git --git-dir=dst/.git config --add \
+ receive.fsck.missingEmail ignore &&
+ git --git-dir=dst/.git config --add \
+ receive.fsck.badDate warn &&
+ git push --porcelain dst bogus >act 2>&1 &&
+ test_must_fail grep "missingEmail" act
+'
+
+test_expect_success \
+ 'receive.fsck.unterminatedHeader=warn triggers error' '
+ rm -rf dst &&
+ git init dst &&
+ git --git-dir=dst/.git config receive.fsckobjects true &&
+ git --git-dir=dst/.git config \
+ receive.fsck.unterminatedheader warn &&
+ test_must_fail git push --porcelain dst HEAD >act 2>&1 &&
+ grep "Cannot demote unterminatedheader" act
+'
+
test_done