-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: fetch/receive with fsckobjects
Add tests for the new fetch.fsckobjects, and also tests for receive.fsckobjects we have had for quite some time. Signed-off-by: Junio C Hamano <gitster@pobox.com>
- Loading branch information
Junio C Hamano
committed
Sep 5, 2011
1 parent
dab76d3
commit b10a535
Showing
1 changed file
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
#!/bin/sh | ||
|
||
test_description='fetch/receive strict mode' | ||
. ./test-lib.sh | ||
|
||
test_expect_success setup ' | ||
echo hello >greetings && | ||
git add greetings && | ||
git commit -m greetings && | ||
S=$(git rev-parse :greetings | sed -e "s|^..|&/|") && | ||
X=$(echo bye | git hash-object -w --stdin | sed -e "s|^..|&/|") && | ||
mv -f .git/objects/$X .git/objects/$S && | ||
test_must_fail git fsck | ||
' | ||
|
||
test_expect_success 'fetch without strict' ' | ||
rm -rf dst && | ||
git init dst && | ||
( | ||
cd dst && | ||
git config fetch.fsckobjects false && | ||
git config transfer.fsckobjects false && | ||
git fetch ../.git master | ||
) | ||
' | ||
|
||
test_expect_success 'fetch with !fetch.fsckobjects' ' | ||
rm -rf dst && | ||
git init dst && | ||
( | ||
cd dst && | ||
git config fetch.fsckobjects false && | ||
git config transfer.fsckobjects true && | ||
git fetch ../.git master | ||
) | ||
' | ||
|
||
test_expect_success 'fetch with fetch.fsckobjects' ' | ||
rm -rf dst && | ||
git init dst && | ||
( | ||
cd dst && | ||
git config fetch.fsckobjects true && | ||
git config transfer.fsckobjects false && | ||
test_must_fail git fetch ../.git master | ||
) | ||
' | ||
|
||
test_expect_success 'fetch with transfer.fsckobjects' ' | ||
rm -rf dst && | ||
git init dst && | ||
( | ||
cd dst && | ||
git config transfer.fsckobjects true && | ||
test_must_fail git fetch ../.git master | ||
) | ||
' | ||
|
||
test_expect_success 'push without strict' ' | ||
rm -rf dst && | ||
git init dst && | ||
( | ||
cd dst && | ||
git config fetch.fsckobjects false && | ||
git config transfer.fsckobjects false | ||
) && | ||
git push dst master:refs/heads/test | ||
' | ||
|
||
test_expect_success 'push with !receive.fsckobjects' ' | ||
rm -rf dst && | ||
git init dst && | ||
( | ||
cd dst && | ||
git config receive.fsckobjects false && | ||
git config transfer.fsckobjects true | ||
) && | ||
git push dst master:refs/heads/test | ||
' | ||
|
||
test_expect_success 'push with receive.fsckobjects' ' | ||
rm -rf dst && | ||
git init dst && | ||
( | ||
cd dst && | ||
git config receive.fsckobjects true && | ||
git config transfer.fsckobjects false | ||
) && | ||
test_must_fail git push dst master:refs/heads/test | ||
' | ||
|
||
test_expect_success 'push with transfer.fsckobjects' ' | ||
rm -rf dst && | ||
git init dst && | ||
( | ||
cd dst && | ||
git config transfer.fsckobjects true | ||
) && | ||
test_must_fail git push dst master:refs/heads/test | ||
' | ||
|
||
test_done |