Skip to content

Commit b28a88f

Browse files
peffgitster
authored andcommitted
t5613: drop test_valid_repo function
This function makes sure that "git fsck" does not report any errors. But "--full" has been the default since f29cd39 (fsck: default to "git fsck --full", 2009-10-20), and we can use the exit code (instead of counting the lines) since e2b4f63 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 32d8b42 commit b28a88f

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

t/t5613-info-alternate.sh

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
test_description='test transitive info/alternate entries'
77
. ./test-lib.sh
88

9-
test_valid_repo() {
10-
git fsck --full > fsck.log &&
11-
test_line_count = 0 fsck.log
12-
}
13-
149
base_dir=$(pwd)
1510

1611
test_expect_success 'preparing first repository' \
@@ -52,49 +47,49 @@ git clone --bare -l -s G H'
5247

5348
test_expect_success 'invalidity of deepest repository' \
5449
'cd H && {
55-
test_valid_repo
50+
git fsck
5651
test $? -ne 0
5752
}'
5853

5954
cd "$base_dir"
6055

6156
test_expect_success 'validity of third repository' \
6257
'cd C &&
63-
test_valid_repo'
58+
git fsck'
6459

6560
cd "$base_dir"
6661

6762
test_expect_success 'validity of fourth repository' \
6863
'cd D &&
69-
test_valid_repo'
64+
git fsck'
7065

7166
cd "$base_dir"
7267

7368
test_expect_success 'breaking of loops' \
7469
'echo "$base_dir"/B/.git/objects >> "$base_dir"/A/.git/objects/info/alternates&&
7570
cd C &&
76-
test_valid_repo'
71+
git fsck'
7772

7873
cd "$base_dir"
7974

8075
test_expect_success 'that info/alternates is necessary' \
8176
'cd C &&
8277
rm -f .git/objects/info/alternates &&
83-
! (test_valid_repo)'
78+
! (git fsck)'
8479

8580
cd "$base_dir"
8681

8782
test_expect_success 'that relative alternate is possible for current dir' \
8883
'cd C &&
8984
echo "../../../B/.git/objects" > .git/objects/info/alternates &&
90-
test_valid_repo'
85+
git fsck'
9186

9287
cd "$base_dir"
9388

9489
test_expect_success \
9590
'that relative alternate is only possible for current dir' '
9691
cd D &&
97-
! (test_valid_repo)
92+
! (git fsck)
9893
'
9994

10095
cd "$base_dir"

0 commit comments

Comments
 (0)