-
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.
* 'jc/fsck' (early part): fsck: check loose objects from alternate object stores by default fsck: HEAD is part of refs
- Loading branch information
Showing
2 changed files
with
51 additions
and
14 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
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,31 @@ | ||
#!/bin/sh | ||
|
||
test_description='git fsck random collection of tests' | ||
|
||
. ./test-lib.sh | ||
|
||
test_expect_success setup ' | ||
test_commit A fileA one && | ||
git checkout HEAD^0 && | ||
test_commit B fileB two && | ||
git tag -d A B && | ||
git reflog expire --expire=now --all | ||
' | ||
|
||
test_expect_success 'HEAD is part of refs' ' | ||
test 0 = $(git fsck | wc -l) | ||
' | ||
|
||
test_expect_success 'loose objects borrowed from alternate are not missing' ' | ||
mkdir another && | ||
( | ||
cd another && | ||
git init && | ||
echo ../../../.git/objects >.git/objects/info/alternates && | ||
test_commit C fileC one && | ||
git fsck >out && | ||
! grep "missing blob" out | ||
) | ||
' | ||
|
||
test_done |