3 test_description
='tagopt variable affects "git fetch" and is overridden by commandline.'
5 TEST_PASSES_SANITIZE_LEAK
=true
9 git clone
--mirror .
$1 &&
10 git remote add remote_
$1 $1 &&
16 test_expect_success setup
'
19 git config remote.remote_one.tagopt --no-tags &&
21 git config remote.remote_two.tagopt --tags
24 test_expect_success
"fetch with tagopt=--no-tags does not get tag" '
25 git fetch remote_one &&
26 test_must_fail git show-ref tag_one &&
27 git show-ref remote_one/branch_one
30 test_expect_success
"fetch --tags with tagopt=--no-tags gets tag" '
33 git branch second_branch_one
35 git fetch --tags remote_one &&
36 git show-ref tag_one &&
37 git show-ref remote_one/second_branch_one
40 test_expect_success
"fetch --no-tags with tagopt=--tags does not get tag" '
41 git fetch --no-tags remote_two &&
42 test_must_fail git show-ref tag_two &&
43 git show-ref remote_two/branch_two
46 test_expect_success
"fetch with tagopt=--tags gets tag" '
49 git branch second_branch_two
51 git fetch remote_two &&
52 git show-ref tag_two &&
53 git show-ref remote_two/second_branch_two