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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Oct 3, 2016 at 16:33 UTC
b28a88f26a21e6134a099e2d57aa088bc6d93818
1 file changed
+7
-12
t/t5613-info-alternate.sh
+7
-12
@@ -6,11 +6,6 @@
6
test_description='test transitive info/alternate entries'
7
. ./test-lib.sh
8
9
-test_valid_repo() {
10
- git fsck --full > fsck.log &&
11
- test_line_count = 0 fsck.log
12
-}
13
-
9
base_dir=$(pwd)
10
11
test_expect_success 'preparing first repository' \
@@ -52,7 +47,7 @@ git clone --bare -l -s G H'
47
48
test_expect_success 'invalidity of deepest repository' \
49
'cd H && {
55
- test_valid_repo
50
+ git fsck
51
test $? -ne 0
52
}'
53
@@ -60,41 +55,41 @@ cd "$base_dir"
55
56
test_expect_success 'validity of third repository' \
57
'cd C &&
63
-test_valid_repo'
58
+git fsck'
59
60
cd "$base_dir"
61
62
test_expect_success 'validity of fourth repository' \
63
'cd D &&
69
-test_valid_repo'
64
+git fsck'
65
66
cd "$base_dir"
67
68
test_expect_success 'breaking of loops' \
69
'echo "$base_dir"/B/.git/objects >> "$base_dir"/A/.git/objects/info/alternates&&
70
cd C &&
76
-test_valid_repo'
71
+git fsck'
72
73
cd "$base_dir"
74
75
test_expect_success 'that info/alternates is necessary' \
76
'cd C &&
77
rm -f .git/objects/info/alternates &&
83
-! (test_valid_repo)'
78
+! (git fsck)'
79
80
cd "$base_dir"
81
82
test_expect_success 'that relative alternate is possible for current dir' \
83
'cd C &&
84
echo "../../../B/.git/objects" > .git/objects/info/alternates &&
90
-test_valid_repo'
85
+git fsck'
86
87
cd "$base_dir"
88
89
test_expect_success \
90
'that relative alternate is only possible for current dir' '
91
cd D &&
97
- ! (test_valid_repo)
92
+ ! (git fsck)
93
'
94
95
cd "$base_dir"