Skip to content

Commit 70a4ae7

Browse files
dschogitster
authored andcommitted
fsck: add a simple test for receive.fsck.<msg-id>
Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7d7d5b0 commit 70a4ae7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

t/t5504-fetch-receive-strict.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,25 @@ test_expect_success 'push with transfer.fsckobjects' '
115115
test_cmp exp act
116116
'
117117

118+
cat >bogus-commit <<\EOF
119+
tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
120+
author Bugs Bunny 1234567890 +0000
121+
committer Bugs Bunny <[email protected]> 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+
118139
test_done

0 commit comments

Comments
 (0)