3 test_description='git receive-pack with alternate ref filtering'
7 test_expect_success 'setup' '
9 git clone -s --bare . fork &&
10 git checkout -b public/branch master &&
12 git checkout -b private/branch master &&
17 depacketize | perl -lne '/^(\S+) \.have/ and print $1'
20 test_expect_success 'with core.alternateRefsCommand' '
21 write_script fork/alternate-refs <<-\EOF &&
22 git --git-dir="$1" for-each-ref \
23 --format="%(objectname)" \
26 test_config -C fork core.alternateRefsCommand ./alternate-refs &&
27 git rev-parse public/branch >expect &&
28 printf "0000" | git receive-pack fork >actual &&
29 extract_haves <actual >actual.haves &&
30 test_cmp expect actual.haves
33 test_expect_success 'with core.alternateRefsPrefixes' '
34 test_config -C fork core.alternateRefsPrefixes "refs/heads/private" &&
35 git rev-parse private/branch >expect &&
36 printf "0000" | git receive-pack fork >actual &&
37 extract_haves <actual >actual.haves &&
38 test_cmp expect actual.haves