t5613: drop test_valid_repo function
This function makes sure that "git fsck" does not report any errors. But "--full" has been the default sincemaintf29cd39
(fsck: default to "git fsck --full", 2009-10-20), and we can use the exit code (instead of counting the lines) sincee2b4f63
(fsck: exit with non-zero status upon errors, 2007-03-05). So we can just use "git fsck", which is shorter and more flexible (e.g., we can use "git -C"). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
parent
32d8b4226a
commit
b28a88f26a
|
@ -6,11 +6,6 @@
|
||||||
test_description='test transitive info/alternate entries'
|
test_description='test transitive info/alternate entries'
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_valid_repo() {
|
|
||||||
git fsck --full > fsck.log &&
|
|
||||||
test_line_count = 0 fsck.log
|
|
||||||
}
|
|
||||||
|
|
||||||
base_dir=$(pwd)
|
base_dir=$(pwd)
|
||||||
|
|
||||||
test_expect_success 'preparing first repository' \
|
test_expect_success 'preparing first repository' \
|
||||||
|
@ -52,7 +47,7 @@ git clone --bare -l -s G H'
|
||||||
|
|
||||||
test_expect_success 'invalidity of deepest repository' \
|
test_expect_success 'invalidity of deepest repository' \
|
||||||
'cd H && {
|
'cd H && {
|
||||||
test_valid_repo
|
git fsck
|
||||||
test $? -ne 0
|
test $? -ne 0
|
||||||
}'
|
}'
|
||||||
|
|
||||||
|
@ -60,41 +55,41 @@ cd "$base_dir"
|
||||||
|
|
||||||
test_expect_success 'validity of third repository' \
|
test_expect_success 'validity of third repository' \
|
||||||
'cd C &&
|
'cd C &&
|
||||||
test_valid_repo'
|
git fsck'
|
||||||
|
|
||||||
cd "$base_dir"
|
cd "$base_dir"
|
||||||
|
|
||||||
test_expect_success 'validity of fourth repository' \
|
test_expect_success 'validity of fourth repository' \
|
||||||
'cd D &&
|
'cd D &&
|
||||||
test_valid_repo'
|
git fsck'
|
||||||
|
|
||||||
cd "$base_dir"
|
cd "$base_dir"
|
||||||
|
|
||||||
test_expect_success 'breaking of loops' \
|
test_expect_success 'breaking of loops' \
|
||||||
'echo "$base_dir"/B/.git/objects >> "$base_dir"/A/.git/objects/info/alternates&&
|
'echo "$base_dir"/B/.git/objects >> "$base_dir"/A/.git/objects/info/alternates&&
|
||||||
cd C &&
|
cd C &&
|
||||||
test_valid_repo'
|
git fsck'
|
||||||
|
|
||||||
cd "$base_dir"
|
cd "$base_dir"
|
||||||
|
|
||||||
test_expect_success 'that info/alternates is necessary' \
|
test_expect_success 'that info/alternates is necessary' \
|
||||||
'cd C &&
|
'cd C &&
|
||||||
rm -f .git/objects/info/alternates &&
|
rm -f .git/objects/info/alternates &&
|
||||||
! (test_valid_repo)'
|
! (git fsck)'
|
||||||
|
|
||||||
cd "$base_dir"
|
cd "$base_dir"
|
||||||
|
|
||||||
test_expect_success 'that relative alternate is possible for current dir' \
|
test_expect_success 'that relative alternate is possible for current dir' \
|
||||||
'cd C &&
|
'cd C &&
|
||||||
echo "../../../B/.git/objects" > .git/objects/info/alternates &&
|
echo "../../../B/.git/objects" > .git/objects/info/alternates &&
|
||||||
test_valid_repo'
|
git fsck'
|
||||||
|
|
||||||
cd "$base_dir"
|
cd "$base_dir"
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success \
|
||||||
'that relative alternate is only possible for current dir' '
|
'that relative alternate is only possible for current dir' '
|
||||||
cd D &&
|
cd D &&
|
||||||
! (test_valid_repo)
|
! (git fsck)
|
||||||
'
|
'
|
||||||
|
|
||||||
cd "$base_dir"
|
cd "$base_dir"
|
||||||
|
|
Loading…
Reference in New Issue