1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-18 23:14:51 +01:00
git/t/t1450-fsck.sh
Junio C Hamano e15ef66943 fsck: check loose objects from alternate object stores by default
"git fsck" used to validate only loose objects that are local and nothing
else by default.  This is not just too little when a repository is
borrowing objects from other object stores, but also caused the
connectivity check to mistakenly declare loose objects borrowed from them
to be missing.

The rationale behind the default mode that validates only loose objects is
because these objects are still young and more unlikely to have been
pushed to other repositories yet.  That holds for loose objects borrowed
from alternate object stores as well.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-30 19:23:22 -08:00

31 lines
613 B
Bash
Executable file

#!/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