diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2015-06-22 18:27:12 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-06-24 00:27:37 +0300 |
commit | 02976bf856bc47ea2bcb9423cd13b6f69ce58929 (patch) | |
tree | fa1efe6204a7ac1055211214f169f17f589f3b9c /t/t1450-fsck.sh | |
parent | 2becf00ff70b324999d0e3046d828a80884ab561 (diff) |
fsck: introduce `git fsck --connectivity-only`
This option avoids unpacking each and all blob objects, and just
verifies the connectivity. In particular with large repositories, this
speeds up the operation, at the expense of missing corrupt blobs,
ignoring unreachable objects and other fsck issues, if any.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1450-fsck.sh')
-rwxr-xr-x | t/t1450-fsck.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh index 17271295f3..956673b8a1 100755 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@ -431,4 +431,26 @@ test_expect_success 'fsck notices ref pointing to missing tag' ' test_must_fail git -C missing fsck ' +test_expect_success 'fsck --connectivity-only' ' + rm -rf connectivity-only && + git init connectivity-only && + ( + cd connectivity-only && + touch empty && + git add empty && + test_commit empty && + empty=.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 && + rm -f $empty && + echo invalid >$empty && + test_must_fail git fsck --strict && + git fsck --strict --connectivity-only && + tree=$(git rev-parse HEAD:) && + suffix=${tree#??} && + tree=.git/objects/${tree%$suffix}/$suffix && + rm -f $tree && + echo invalid >$tree && + test_must_fail git fsck --strict --connectivity-only + ) +' + test_done |