diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-04-24 07:07:49 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-04-24 07:07:49 +0200 |
commit | cdfe138b360cd10f74ef9d2d031cb10447cb3338 (patch) | |
tree | 44a8d80a209a2f490ae0575c634ea50e7a6e3ac7 /t | |
parent | Merge branch 'jh/unpack-trees-micro-optim' (diff) | |
parent | read-cache: force_verify_index_checksum (diff) | |
download | git-cdfe138b360cd10f74ef9d2d031cb10447cb3338.tar.xz git-cdfe138b360cd10f74ef9d2d031cb10447cb3338.zip |
Merge branch 'jh/verify-index-checksum-only-in-fsck'
The index file has a trailing SHA-1 checksum to detect file
corruption, and historically we checked it every time the index
file is used. Omit the validation during normal use, and instead
verify only in "git fsck".
* jh/verify-index-checksum-only-in-fsck:
read-cache: force_verify_index_checksum
Diffstat (limited to 't')
-rwxr-xr-x | t/t1450-fsck.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh index 33a51c9a67..677e15a7a4 100755 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@ -689,4 +689,17 @@ test_expect_success 'bogus head does not fallback to all heads' ' ! grep $blob out ' +test_expect_success 'detect corrupt index file in fsck' ' + cp .git/index .git/index.backup && + test_when_finished "mv .git/index.backup .git/index" && + echo zzzzzzzz >zzzzzzzz && + git add zzzzzzzz && + sed -e "s/zzzzzzzz/yyyyyyyy/" .git/index >.git/index.yyy && + mv .git/index.yyy .git/index && + # Confirm that fsck detects invalid checksum + test_must_fail git fsck --cache && + # Confirm that status no longer complains about invalid checksum + git status +' + test_done |