3 test_description='fetch/push involving alternates'
4 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
12 git count-objects -v |
13 sed -n -e 's/^count: \(.*\)/loose=\1/p' \
14 -e 's/^in-pack: \(.*\)/inpack=\1/p'
16 echo $(( $loose + $inpack ))
20 test_expect_success setup '
29 git commit -m "$i" || exit
34 git clone --reference=original "file://$(pwd)/original" one &&
39 count_objects >../one.count
41 A=$(pwd)/original/.git/objects &&
43 echo "$A" >receiver/.git/objects/info/alternates &&
45 echo "$A" >fetcher/.git/objects/info/alternates
48 test_expect_success 'pushing into a repository with the same alternate' '
51 git push ../receiver main:refs/heads/it
55 count_objects >../receiver.count
57 test_cmp one.count receiver.count
60 test_expect_success 'fetching from a repository with the same alternate' '
63 git fetch ../one main:refs/heads/it &&
64 count_objects >../fetcher.count
66 test_cmp one.count fetcher.count