3 test_description
='test automatic tag following'
9 say
"GIT_DEBUG_SEND_PACK not supported - skipping tests"
12 test_set_prereq NOT_MINGW
16 # End state of the repository:
20 # L - A ------ O ------ B
23 # origin/master master
25 test_expect_success NOT_MINGW setup
'
30 L=$(git rev-parse --verify HEAD) &&
36 git remote add -f origin ..
43 A=$(git rev-parse --verify HEAD)
48 test_expect_success NOT_MINGW
'setup expect' '
56 test_expect_success NOT_MINGW
'fetch A (new commit : 1 connection)' '
60 GIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&
61 test $A = $(git rev-parse --verify origin/master)
64 cut -d" " -f1,2 $U >actual &&
65 test_cmp expect actual
68 test_expect_success NOT_MINGW
"create tag T on A, create C on branch cat" '
69 git tag -a -m tag1 tag1 $A &&
70 T=$(git rev-parse --verify tag1) &&
72 git checkout -b cat &&
76 C=$(git rev-parse --verify HEAD) &&
80 test_expect_success NOT_MINGW
'setup expect' '
89 test_expect_success NOT_MINGW
'fetch C, T (new branch, tag : 1 connection)' '
93 GIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&
94 test $C = $(git rev-parse --verify origin/cat) &&
95 test $T = $(git rev-parse --verify tag1) &&
96 test $A = $(git rev-parse --verify tag1^0)
99 cut -d" " -f1,2 $U >actual &&
100 test_cmp expect actual
103 test_expect_success NOT_MINGW
"create commits O, B, tag S on B" '
113 B=$(git rev-parse --verify HEAD) &&
115 git tag -a -m tag2 tag2 $B &&
116 S=$(git rev-parse --verify tag2)
119 test_expect_success NOT_MINGW
'setup expect' '
128 test_expect_success NOT_MINGW
'fetch B, S (commit and tag : 1 connection)' '
132 GIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&
133 test $B = $(git rev-parse --verify origin/master) &&
134 test $B = $(git rev-parse --verify tag2^0) &&
135 test $S = $(git rev-parse --verify tag2)
138 cut -d" " -f1,2 $U >actual &&
139 test_cmp expect actual
142 test_expect_success NOT_MINGW
'setup expect' '
151 test_expect_success NOT_MINGW
'new clone fetch master and tags' '
158 git remote add origin .. &&
159 GIT_DEBUG_SEND_PACK=3 git fetch 3>../$U &&
160 test $B = $(git rev-parse --verify origin/master) &&
161 test $S = $(git rev-parse --verify tag2) &&
162 test $B = $(git rev-parse --verify tag2^0) &&
163 test $T = $(git rev-parse --verify tag1) &&
164 test $A = $(git rev-parse --verify tag1^0)
167 cut -d" " -f1,2 $U >actual &&
168 test_cmp expect actual