Skip to content

Commit a3cc31f

Browse files
author
Junio C Hamano
committed
Merge branch 'jc/fix5500'
* jc/fix5500: t5500: test fix
2 parents 40c2fe0 + 7f732c6 commit a3cc31f

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

t/t5500-fetch-pack.sh

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ test_description='Testing multi_ack pack fetching
1212

1313
# Some convenience functions
1414

15-
function show_count () {
16-
commit_count=$(($commit_count+1))
17-
printf " %d\r" $commit_count
18-
}
19-
2015
function add () {
2116
local name=$1
2217
local text="$@"
@@ -55,13 +50,6 @@ function test_expect_object_count () {
5550
"test $count = $output"
5651
}
5752

58-
function test_repack () {
59-
local rep=$1
60-
61-
test_expect_success "repack && prune-packed in $rep" \
62-
'(git-repack && git-prune-packed)2>>log.txt'
63-
}
64-
6553
function pull_to_client () {
6654
local number=$1
6755
local heads=$2
@@ -70,20 +58,31 @@ function pull_to_client () {
7058

7159
cd client
7260
test_expect_success "$number pull" \
73-
"git-fetch-pack -v .. $heads > log.txt 2>&1"
61+
"git-fetch-pack -k -v .. $heads"
7462
case "$heads" in *A*) echo $ATIP > .git/refs/heads/A;; esac
7563
case "$heads" in *B*) echo $BTIP > .git/refs/heads/B;; esac
7664
git-symbolic-ref HEAD refs/heads/${heads:0:1}
65+
7766
test_expect_success "fsck" 'git-fsck-objects --full > fsck.txt 2>&1'
78-
test_expect_object_count "after $number pull" $count
79-
pack_count=$(grep Unpacking log.txt|tr -dc "0-9")
67+
68+
test_expect_success 'check downloaded results' \
69+
'mv .git/objects/pack/pack-* . &&
70+
p=`ls -1 pack-*.pack` &&
71+
git-unpack-objects <$p &&
72+
git-fsck-objects --full'
73+
74+
test_expect_success "new object count after $number pull" \
75+
'idx=`echo pack-*.idx` &&
76+
pack_count=`git-show-index <$idx | wc -l` &&
77+
test $pack_count = $count'
8078
test -z "$pack_count" && pack_count=0
8179
if [ -z "$no_strict_count_check" ]; then
8280
test_expect_success "minimal count" "test $count = $pack_count"
8381
else
8482
test $count != $pack_count && \
8583
echo "WARNING: $pack_count objects transmitted, only $count of which were needed"
8684
fi
85+
rm -f pack-*
8786
cd ..
8887
}
8988

@@ -117,8 +116,6 @@ git-symbolic-ref HEAD refs/heads/B
117116

118117
pull_to_client 1st "B A" $((11*3))
119118

120-
(cd client; test_repack client)
121-
122119
add A11 $A10
123120

124121
prev=1; cur=2; while [ $cur -le 65 ]; do
@@ -129,8 +126,6 @@ done
129126

130127
pull_to_client 2nd "B" $((64*3))
131128

132-
(cd client; test_repack client)
133-
134129
pull_to_client 3rd "A" $((1*3)) # old fails
135130

136131
test_done

0 commit comments

Comments
 (0)