fsck: add a simple test for receive.fsck.<msg-id>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Jun 22, 2015 at 17:26 UTC
70a4ae73d8a6d8d0ce86d746a20bb243d83d28e3
1 file changed
+21
t/t5504-fetch-receive-strict.sh
+21
@@ -115,4 +115,25 @@ test_expect_success 'push with transfer.fsckobjects' '
115
test_cmp exp act
116
'
117
118
+cat >bogus-commit <<\EOF
119
+tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
120
+author Bugs Bunny 1234567890 +0000
121
+committer Bugs Bunny <bugs@bun.ni> 1234567890 +0000
122
+
123
+This commit object intentionally broken
124
+EOF
125
+
126
+test_expect_success 'push with receive.fsck.missingEmail=warn' '
127
+ commit="$(git hash-object -t commit -w --stdin <bogus-commit)" &&
128
+ git push . $commit:refs/heads/bogus &&
129
+ rm -rf dst &&
130
+ git init dst &&
131
+ git --git-dir=dst/.git config receive.fsckobjects true &&
132
+ test_must_fail git push --porcelain dst bogus &&
133
+ git --git-dir=dst/.git config \
134
+ receive.fsck.missingEmail warn &&
135
+ git push --porcelain dst bogus >act 2>&1 &&
136
+ grep "missingEmail" act
137
+'
138
+
139
test_done