Skip to content

Commit

Permalink
fsck: add a simple test for receive.fsck.<msg-id>
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Jun 23, 2015
1 parent 7d7d5b0 commit 70a4ae7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions t/t5504-fetch-receive-strict.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,25 @@ 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.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
'

test_done

0 comments on commit 70a4ae7

Please sign in to comment.