@matheusbsbs / matheus-bagliano / commits / 2e674a9d09
Fork 0

t5510: harden the way verify-pack is used

The test ignored the exit status from verify pack command, and also relied on not seeing any delta chain statistics. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Aug 7, 2009 at 20:12 UTC 2e674a9d090f0d9be71c8143ae6c0fba04a160cc
1 file changed +8 -3
t/t5510-fetch.sh
+8 -3
@@ -9,6 +9,11 @@ test_description='Per branch config variables affects "git fetch".
9
10 D=`pwd`
11
12 +test_bundle_object_count () {
13 + git verify-pack -v "$1" >verify.out &&
14 + test "$2" = $(grep '^[0-9a-f]\{40\} ' verify.out | wc -l)
15 +}
16 +
17 test_expect_success setup '
18 echo >file original &&
19 git add file &&
@@ -146,6 +151,7 @@ test_expect_success 'unbundle 1' '
151 test_must_fail git fetch "$D/bundle1" master:master
152 '
153
154 +
155 test_expect_success 'bundle 1 has only 3 files ' '
156 cd "$D" &&
157 (
@@ -156,8 +162,7 @@ test_expect_success 'bundle 1 has only 3 files ' '
162 cat
163 ) <bundle1 >bundle.pack &&
164 git index-pack bundle.pack &&
159 - verify=$(git verify-pack -v bundle.pack) &&
160 - test 4 = $(echo "$verify" | wc -l)
165 + test_bundle_object_count bundle.pack 3
166 '
167
168 test_expect_success 'unbundle 2' '
@@ -180,7 +185,7 @@ test_expect_success 'bundle does not prerequisite objects' '
185 cat
186 ) <bundle3 >bundle.pack &&
187 git index-pack bundle.pack &&
183 - test 4 = $(git verify-pack -v bundle.pack | wc -l)
188 + test_bundle_object_count bundle.pack 3
189 '
190
191 test_expect_success 'bundle should be able to create a full history' '