Merge branch 'ao/send-email-irt'
[git/kirr.git] / t / t5525-fetch-tagopt.sh
blob4fbf7a120f3fd4133e09cb7cbe5c8e4597bfa27c
1 #!/bin/sh
3 test_description='tagopt variable affects "git fetch" and is overridden by commandline.'
5 . ./test-lib.sh
7 setup_clone () {
8 git clone --mirror . $1 &&
9 git remote add remote_$1 $1 &&
10 (cd $1 &&
11 git tag tag_$1)
14 test_expect_success setup '
15 test_commit test &&
16 setup_clone one &&
17 git config remote.remote_one.tagopt --no-tags &&
18 setup_clone two &&
19 git config remote.remote_two.tagopt --tags
22 test_expect_success "fetch with tagopt=--no-tags does not get tag" '
23 git fetch remote_one &&
24 test_must_fail git show-ref tag_one
27 test_expect_success "fetch --tags with tagopt=--no-tags gets tag" '
28 git fetch --tags remote_one &&
29 git show-ref tag_one
32 test_expect_success "fetch --no-tags with tagopt=--tags does not get tag" '
33 git fetch --no-tags remote_two &&
34 test_must_fail git show-ref tag_two
37 test_expect_success "fetch with tagopt=--tags gets tag" '
38 git fetch remote_two &&
39 git show-ref tag_two
41 test_done