]>
Commit | Line | Data |
---|---|---|
ef5a6fb5 CR |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2007 Carlos Rica | |
4 | # | |
5 | ||
6 | test_description='git-tag | |
7 | ||
62e09ce9 | 8 | Tests for operations with tags.' |
ef5a6fb5 CR |
9 | |
10 | . ./test-lib.sh | |
11 | ||
12 | # creating and listing lightweight tags: | |
13 | ||
14 | tag_exists () { | |
15 | git show-ref --quiet --verify refs/tags/"$1" | |
16 | } | |
17 | ||
18 | # todo: git tag -l now returns always zero, when fixed, change this test | |
62e09ce9 CR |
19 | test_expect_success 'listing all tags in an empty tree should succeed' ' |
20 | git tag -l && | |
21 | git tag | |
22 | ' | |
ef5a6fb5 | 23 | |
62e09ce9 CR |
24 | test_expect_success 'listing all tags in an empty tree should output nothing' ' |
25 | test `git-tag -l | wc -l` -eq 0 && | |
26 | test `git-tag | wc -l` -eq 0 | |
27 | ' | |
ef5a6fb5 | 28 | |
41ac414e JH |
29 | test_expect_success 'looking for a tag in an empty tree should fail' \ |
30 | '! (tag_exists mytag)' | |
ef5a6fb5 CR |
31 | |
32 | test_expect_success 'creating a tag in an empty tree should fail' ' | |
33 | ! git-tag mynotag && | |
34 | ! tag_exists mynotag | |
35 | ' | |
36 | ||
37 | test_expect_success 'creating a tag for HEAD in an empty tree should fail' ' | |
38 | ! git-tag mytaghead HEAD && | |
39 | ! tag_exists mytaghead | |
40 | ' | |
41 | ||
42 | test_expect_success 'creating a tag for an unknown revision should fail' ' | |
43 | ! git-tag mytagnorev aaaaaaaaaaa && | |
44 | ! tag_exists mytagnorev | |
45 | ' | |
46 | ||
47 | # commit used in the tests, test_tick is also called here to freeze the date: | |
48 | test_expect_success 'creating a tag using default HEAD should succeed' ' | |
49 | test_tick && | |
50 | echo foo >foo && | |
51 | git add foo && | |
52 | git commit -m Foo && | |
53 | git tag mytag | |
54 | ' | |
55 | ||
62e09ce9 CR |
56 | test_expect_success 'listing all tags if one exists should succeed' ' |
57 | git-tag -l && | |
58 | git-tag | |
59 | ' | |
ef5a6fb5 | 60 | |
62e09ce9 CR |
61 | test_expect_success 'listing all tags if one exists should output that tag' ' |
62 | test `git-tag -l` = mytag && | |
63 | test `git-tag` = mytag | |
64 | ' | |
ef5a6fb5 CR |
65 | |
66 | # pattern matching: | |
67 | ||
68 | test_expect_success 'listing a tag using a matching pattern should succeed' \ | |
69 | 'git-tag -l mytag' | |
70 | ||
71 | test_expect_success \ | |
72 | 'listing a tag using a matching pattern should output that tag' \ | |
73 | 'test `git-tag -l mytag` = mytag' | |
74 | ||
75 | # todo: git tag -l now returns always zero, when fixed, change this test | |
76 | test_expect_success \ | |
77 | 'listing tags using a non-matching pattern should suceed' \ | |
78 | 'git-tag -l xxx' | |
79 | ||
80 | test_expect_success \ | |
81 | 'listing tags using a non-matching pattern should output nothing' \ | |
82 | 'test `git-tag -l xxx | wc -l` -eq 0' | |
83 | ||
84 | # special cases for creating tags: | |
85 | ||
41ac414e | 86 | test_expect_success \ |
ef5a6fb5 | 87 | 'trying to create a tag with the name of one existing should fail' \ |
41ac414e | 88 | '! git tag mytag' |
ef5a6fb5 CR |
89 | |
90 | test_expect_success \ | |
91 | 'trying to create a tag with a non-valid name should fail' ' | |
92 | test `git-tag -l | wc -l` -eq 1 && | |
93 | ! git tag "" && | |
94 | ! git tag .othertag && | |
95 | ! git tag "other tag" && | |
96 | ! git tag "othertag^" && | |
97 | ! git tag "other~tag" && | |
98 | test `git-tag -l | wc -l` -eq 1 | |
99 | ' | |
100 | ||
101 | test_expect_success 'creating a tag using HEAD directly should succeed' ' | |
102 | git tag myhead HEAD && | |
103 | tag_exists myhead | |
104 | ' | |
105 | ||
106 | # deleting tags: | |
107 | ||
108 | test_expect_success 'trying to delete an unknown tag should fail' ' | |
109 | ! tag_exists unknown-tag && | |
110 | ! git-tag -d unknown-tag | |
111 | ' | |
112 | ||
113 | cat >expect <<EOF | |
114 | myhead | |
115 | mytag | |
116 | EOF | |
117 | test_expect_success \ | |
118 | 'trying to delete tags without params should succeed and do nothing' ' | |
119 | git tag -l > actual && git diff expect actual && | |
120 | git-tag -d && | |
121 | git tag -l > actual && git diff expect actual | |
122 | ' | |
123 | ||
124 | test_expect_success \ | |
125 | 'deleting two existing tags in one command should succeed' ' | |
126 | tag_exists mytag && | |
127 | tag_exists myhead && | |
128 | git-tag -d mytag myhead && | |
129 | ! tag_exists mytag && | |
130 | ! tag_exists myhead | |
131 | ' | |
132 | ||
133 | test_expect_success \ | |
134 | 'creating a tag with the name of another deleted one should succeed' ' | |
135 | ! tag_exists mytag && | |
136 | git-tag mytag && | |
137 | tag_exists mytag | |
138 | ' | |
139 | ||
140 | test_expect_success \ | |
141 | 'trying to delete two tags, existing and not, should fail in the 2nd' ' | |
142 | tag_exists mytag && | |
143 | ! tag_exists myhead && | |
144 | ! git-tag -d mytag anothertag && | |
145 | ! tag_exists mytag && | |
146 | ! tag_exists myhead | |
147 | ' | |
148 | ||
41ac414e JH |
149 | test_expect_success 'trying to delete an already deleted tag should fail' \ |
150 | '! git-tag -d mytag' | |
ef5a6fb5 CR |
151 | |
152 | # listing various tags with pattern matching: | |
153 | ||
154 | cat >expect <<EOF | |
155 | a1 | |
156 | aa1 | |
157 | cba | |
158 | t210 | |
159 | t211 | |
160 | v0.2.1 | |
161 | v1.0 | |
162 | v1.0.1 | |
163 | v1.1.3 | |
164 | EOF | |
165 | test_expect_success 'listing all tags should print them ordered' ' | |
166 | git tag v1.0.1 && | |
167 | git tag t211 && | |
168 | git tag aa1 && | |
169 | git tag v0.2.1 && | |
170 | git tag v1.1.3 && | |
171 | git tag cba && | |
172 | git tag a1 && | |
173 | git tag v1.0 && | |
174 | git tag t210 && | |
5206d130 | 175 | git tag -l > actual && |
62e09ce9 CR |
176 | git diff expect actual && |
177 | git tag > actual && | |
ef5a6fb5 CR |
178 | git diff expect actual |
179 | ' | |
180 | ||
181 | cat >expect <<EOF | |
182 | a1 | |
183 | aa1 | |
184 | cba | |
185 | EOF | |
186 | test_expect_success \ | |
187 | 'listing tags with substring as pattern must print those matching' ' | |
18e32b5b | 188 | git-tag -l "*a*" > actual && |
5be60078 | 189 | git diff expect actual |
ef5a6fb5 CR |
190 | ' |
191 | ||
192 | cat >expect <<EOF | |
193 | v0.2.1 | |
194 | v1.0.1 | |
ef5a6fb5 CR |
195 | EOF |
196 | test_expect_success \ | |
18e32b5b CR |
197 | 'listing tags with a suffix as pattern must print those matching' ' |
198 | git-tag -l "*.1" > actual && | |
5be60078 | 199 | git diff expect actual |
ef5a6fb5 CR |
200 | ' |
201 | ||
202 | cat >expect <<EOF | |
203 | t210 | |
204 | t211 | |
205 | EOF | |
206 | test_expect_success \ | |
18e32b5b CR |
207 | 'listing tags with a prefix as pattern must print those matching' ' |
208 | git-tag -l "t21*" > actual && | |
5be60078 | 209 | git diff expect actual |
ef5a6fb5 CR |
210 | ' |
211 | ||
212 | cat >expect <<EOF | |
213 | a1 | |
ef5a6fb5 CR |
214 | EOF |
215 | test_expect_success \ | |
18e32b5b | 216 | 'listing tags using a name as pattern must print that one matching' ' |
ef5a6fb5 | 217 | git-tag -l a1 > actual && |
5be60078 | 218 | git diff expect actual |
ef5a6fb5 CR |
219 | ' |
220 | ||
221 | cat >expect <<EOF | |
222 | v1.0 | |
ef5a6fb5 CR |
223 | EOF |
224 | test_expect_success \ | |
18e32b5b | 225 | 'listing tags using a name as pattern must print that one matching' ' |
ef5a6fb5 | 226 | git-tag -l v1.0 > actual && |
5be60078 | 227 | git diff expect actual |
ef5a6fb5 CR |
228 | ' |
229 | ||
230 | cat >expect <<EOF | |
18e32b5b | 231 | v1.0.1 |
ef5a6fb5 CR |
232 | v1.1.3 |
233 | EOF | |
234 | test_expect_success \ | |
235 | 'listing tags with ? in the pattern should print those matching' ' | |
18e32b5b | 236 | git-tag -l "v1.?.?" > actual && |
5be60078 | 237 | git diff expect actual |
ef5a6fb5 CR |
238 | ' |
239 | ||
240 | >expect | |
241 | test_expect_success \ | |
242 | 'listing tags using v.* should print nothing because none have v.' ' | |
243 | git-tag -l "v.*" > actual && | |
5be60078 | 244 | git diff expect actual |
ef5a6fb5 CR |
245 | ' |
246 | ||
247 | cat >expect <<EOF | |
248 | v0.2.1 | |
249 | v1.0 | |
250 | v1.0.1 | |
251 | v1.1.3 | |
252 | EOF | |
253 | test_expect_success \ | |
254 | 'listing tags using v* should print only those having v' ' | |
255 | git-tag -l "v*" > actual && | |
5be60078 | 256 | git diff expect actual |
ef5a6fb5 CR |
257 | ' |
258 | ||
259 | # creating and verifying lightweight tags: | |
260 | ||
261 | test_expect_success \ | |
262 | 'a non-annotated tag created without parameters should point to HEAD' ' | |
263 | git-tag non-annotated-tag && | |
5be60078 JH |
264 | test $(git cat-file -t non-annotated-tag) = commit && |
265 | test $(git rev-parse non-annotated-tag) = $(git rev-parse HEAD) | |
ef5a6fb5 CR |
266 | ' |
267 | ||
41ac414e JH |
268 | test_expect_success 'trying to verify an unknown tag should fail' \ |
269 | '! git-tag -v unknown-tag' | |
ef5a6fb5 | 270 | |
41ac414e | 271 | test_expect_success \ |
ef5a6fb5 | 272 | 'trying to verify a non-annotated and non-signed tag should fail' \ |
41ac414e | 273 | '! git-tag -v non-annotated-tag' |
ef5a6fb5 | 274 | |
41ac414e | 275 | test_expect_success \ |
62e09ce9 | 276 | 'trying to verify many non-annotated or unknown tags, should fail' \ |
41ac414e | 277 | '! git-tag -v unknown-tag1 non-annotated-tag unknown-tag2' |
62e09ce9 | 278 | |
ef5a6fb5 CR |
279 | # creating annotated tags: |
280 | ||
281 | get_tag_msg () { | |
282 | git cat-file tag "$1" | sed -e "/BEGIN PGP/q" | |
283 | } | |
284 | ||
285 | # run test_tick before committing always gives the time in that timezone | |
286 | get_tag_header () { | |
287 | cat <<EOF | |
288 | object $2 | |
289 | type $3 | |
290 | tag $1 | |
291 | tagger C O Mitter <committer@example.com> $4 -0700 | |
292 | ||
293 | EOF | |
294 | } | |
295 | ||
296 | commit=$(git rev-parse HEAD) | |
297 | time=$test_tick | |
298 | ||
299 | get_tag_header annotated-tag $commit commit $time >expect | |
300 | echo "A message" >>expect | |
301 | test_expect_success \ | |
302 | 'creating an annotated tag with -m message should succeed' ' | |
303 | git-tag -m "A message" annotated-tag && | |
304 | get_tag_msg annotated-tag >actual && | |
305 | git diff expect actual | |
306 | ' | |
307 | ||
308 | cat >msgfile <<EOF | |
309 | Another message | |
310 | in a file. | |
311 | EOF | |
312 | get_tag_header file-annotated-tag $commit commit $time >expect | |
313 | cat msgfile >>expect | |
314 | test_expect_success \ | |
315 | 'creating an annotated tag with -F messagefile should succeed' ' | |
316 | git-tag -F msgfile file-annotated-tag && | |
317 | get_tag_msg file-annotated-tag >actual && | |
318 | git diff expect actual | |
319 | ' | |
320 | ||
62e09ce9 CR |
321 | cat >inputmsg <<EOF |
322 | A message from the | |
323 | standard input | |
324 | EOF | |
325 | get_tag_header stdin-annotated-tag $commit commit $time >expect | |
326 | cat inputmsg >>expect | |
327 | test_expect_success 'creating an annotated tag with -F - should succeed' ' | |
328 | git-tag -F - stdin-annotated-tag <inputmsg && | |
329 | get_tag_msg stdin-annotated-tag >actual && | |
330 | git diff expect actual | |
331 | ' | |
332 | ||
e317cfaf CR |
333 | test_expect_success \ |
334 | 'trying to create a tag with a non-existing -F file should fail' ' | |
335 | ! test -f nonexistingfile && | |
336 | ! tag_exists notag && | |
337 | ! git-tag -F nonexistingfile notag && | |
338 | ! tag_exists notag | |
339 | ' | |
340 | ||
341 | test_expect_success \ | |
39686585 | 342 | 'trying to create tags giving both -m or -F options should fail' ' |
e317cfaf CR |
343 | echo "message file 1" >msgfile1 && |
344 | echo "message file 2" >msgfile2 && | |
345 | ! tag_exists msgtag && | |
e317cfaf CR |
346 | ! git-tag -m "message 1" -F msgfile1 msgtag && |
347 | ! tag_exists msgtag && | |
348 | ! git-tag -F msgfile1 -m "message 1" msgtag && | |
349 | ! tag_exists msgtag && | |
e317cfaf CR |
350 | ! git-tag -m "message 1" -F msgfile1 -m "message 2" msgtag && |
351 | ! tag_exists msgtag | |
352 | ' | |
353 | ||
ef5a6fb5 CR |
354 | # blank and empty messages: |
355 | ||
356 | get_tag_header empty-annotated-tag $commit commit $time >expect | |
357 | test_expect_success \ | |
358 | 'creating a tag with an empty -m message should succeed' ' | |
359 | git-tag -m "" empty-annotated-tag && | |
360 | get_tag_msg empty-annotated-tag >actual && | |
361 | git diff expect actual | |
362 | ' | |
363 | ||
364 | >emptyfile | |
365 | get_tag_header emptyfile-annotated-tag $commit commit $time >expect | |
366 | test_expect_success \ | |
367 | 'creating a tag with an empty -F messagefile should succeed' ' | |
368 | git-tag -F emptyfile emptyfile-annotated-tag && | |
369 | get_tag_msg emptyfile-annotated-tag >actual && | |
370 | git diff expect actual | |
371 | ' | |
372 | ||
373 | printf '\n\n \n\t\nLeading blank lines\n' >blanksfile | |
374 | printf '\n\t \t \nRepeated blank lines\n' >>blanksfile | |
375 | printf '\n\n\nTrailing spaces \t \n' >>blanksfile | |
376 | printf '\nTrailing blank lines\n\n\t \n\n' >>blanksfile | |
377 | get_tag_header blanks-annotated-tag $commit commit $time >expect | |
378 | cat >>expect <<EOF | |
379 | Leading blank lines | |
380 | ||
381 | Repeated blank lines | |
382 | ||
383 | Trailing spaces | |
384 | ||
385 | Trailing blank lines | |
386 | EOF | |
387 | test_expect_success \ | |
388 | 'extra blanks in the message for an annotated tag should be removed' ' | |
389 | git-tag -F blanksfile blanks-annotated-tag && | |
390 | get_tag_msg blanks-annotated-tag >actual && | |
391 | git diff expect actual | |
392 | ' | |
393 | ||
394 | get_tag_header blank-annotated-tag $commit commit $time >expect | |
395 | test_expect_success \ | |
396 | 'creating a tag with blank -m message with spaces should succeed' ' | |
397 | git-tag -m " " blank-annotated-tag && | |
398 | get_tag_msg blank-annotated-tag >actual && | |
399 | git diff expect actual | |
400 | ' | |
401 | ||
402 | echo ' ' >blankfile | |
403 | echo '' >>blankfile | |
404 | echo ' ' >>blankfile | |
405 | get_tag_header blankfile-annotated-tag $commit commit $time >expect | |
406 | test_expect_success \ | |
407 | 'creating a tag with blank -F messagefile with spaces should succeed' ' | |
408 | git-tag -F blankfile blankfile-annotated-tag && | |
409 | get_tag_msg blankfile-annotated-tag >actual && | |
410 | git diff expect actual | |
411 | ' | |
412 | ||
413 | printf ' ' >blanknonlfile | |
414 | get_tag_header blanknonlfile-annotated-tag $commit commit $time >expect | |
415 | test_expect_success \ | |
416 | 'creating a tag with -F file of spaces and no newline should succeed' ' | |
417 | git-tag -F blanknonlfile blanknonlfile-annotated-tag && | |
418 | get_tag_msg blanknonlfile-annotated-tag >actual && | |
419 | git diff expect actual | |
420 | ' | |
421 | ||
422 | # messages with commented lines: | |
423 | ||
424 | cat >commentsfile <<EOF | |
425 | # A comment | |
426 | ||
427 | ############ | |
428 | The message. | |
429 | ############ | |
430 | One line. | |
431 | ||
432 | ||
433 | # commented lines | |
434 | # commented lines | |
435 | ||
436 | Another line. | |
437 | # comments | |
438 | ||
439 | Last line. | |
440 | EOF | |
441 | get_tag_header comments-annotated-tag $commit commit $time >expect | |
442 | cat >>expect <<EOF | |
443 | The message. | |
444 | One line. | |
445 | ||
446 | Another line. | |
447 | ||
448 | Last line. | |
449 | EOF | |
450 | test_expect_success \ | |
451 | 'creating a tag using a -F messagefile with #comments should succeed' ' | |
452 | git-tag -F commentsfile comments-annotated-tag && | |
453 | get_tag_msg comments-annotated-tag >actual && | |
454 | git diff expect actual | |
455 | ' | |
456 | ||
457 | get_tag_header comment-annotated-tag $commit commit $time >expect | |
458 | test_expect_success \ | |
459 | 'creating a tag with a #comment in the -m message should succeed' ' | |
460 | git-tag -m "#comment" comment-annotated-tag && | |
461 | get_tag_msg comment-annotated-tag >actual && | |
462 | git diff expect actual | |
463 | ' | |
464 | ||
465 | echo '#comment' >commentfile | |
466 | echo '' >>commentfile | |
467 | echo '####' >>commentfile | |
468 | get_tag_header commentfile-annotated-tag $commit commit $time >expect | |
469 | test_expect_success \ | |
470 | 'creating a tag with #comments in the -F messagefile should succeed' ' | |
471 | git-tag -F commentfile commentfile-annotated-tag && | |
472 | get_tag_msg commentfile-annotated-tag >actual && | |
473 | git diff expect actual | |
474 | ' | |
475 | ||
476 | printf '#comment' >commentnonlfile | |
477 | get_tag_header commentnonlfile-annotated-tag $commit commit $time >expect | |
478 | test_expect_success \ | |
479 | 'creating a tag with a file of #comment and no newline should succeed' ' | |
480 | git-tag -F commentnonlfile commentnonlfile-annotated-tag && | |
481 | get_tag_msg commentnonlfile-annotated-tag >actual && | |
482 | git diff expect actual | |
483 | ' | |
484 | ||
5206d130 CR |
485 | # listing messages for annotated non-signed tags: |
486 | ||
487 | test_expect_success \ | |
488 | 'listing the one-line message of a non-signed tag should succeed' ' | |
489 | git-tag -m "A msg" tag-one-line && | |
490 | ||
491 | echo "tag-one-line" >expect && | |
492 | git-tag -l | grep "^tag-one-line" >actual && | |
493 | git diff expect actual && | |
c43a2483 | 494 | git-tag -n0 -l | grep "^tag-one-line" >actual && |
5206d130 | 495 | git diff expect actual && |
c43a2483 | 496 | git-tag -n0 -l tag-one-line >actual && |
5206d130 CR |
497 | git diff expect actual && |
498 | ||
499 | echo "tag-one-line A msg" >expect && | |
c43a2483 | 500 | git-tag -n1 -l | grep "^tag-one-line" >actual && |
5206d130 CR |
501 | git diff expect actual && |
502 | git-tag -n -l | grep "^tag-one-line" >actual && | |
503 | git diff expect actual && | |
c43a2483 | 504 | git-tag -n1 -l tag-one-line >actual && |
5206d130 | 505 | git diff expect actual && |
c43a2483 | 506 | git-tag -n2 -l tag-one-line >actual && |
5206d130 | 507 | git diff expect actual && |
c43a2483 | 508 | git-tag -n999 -l tag-one-line >actual && |
5206d130 CR |
509 | git diff expect actual |
510 | ' | |
511 | ||
512 | test_expect_success \ | |
513 | 'listing the zero-lines message of a non-signed tag should succeed' ' | |
514 | git-tag -m "" tag-zero-lines && | |
515 | ||
516 | echo "tag-zero-lines" >expect && | |
517 | git-tag -l | grep "^tag-zero-lines" >actual && | |
518 | git diff expect actual && | |
c43a2483 | 519 | git-tag -n0 -l | grep "^tag-zero-lines" >actual && |
5206d130 | 520 | git diff expect actual && |
c43a2483 | 521 | git-tag -n0 -l tag-zero-lines >actual && |
5206d130 CR |
522 | git diff expect actual && |
523 | ||
524 | echo "tag-zero-lines " >expect && | |
c43a2483 | 525 | git-tag -n1 -l | grep "^tag-zero-lines" >actual && |
5206d130 CR |
526 | git diff expect actual && |
527 | git-tag -n -l | grep "^tag-zero-lines" >actual && | |
528 | git diff expect actual && | |
c43a2483 | 529 | git-tag -n1 -l tag-zero-lines >actual && |
5206d130 | 530 | git diff expect actual && |
c43a2483 | 531 | git-tag -n2 -l tag-zero-lines >actual && |
5206d130 | 532 | git diff expect actual && |
c43a2483 | 533 | git-tag -n999 -l tag-zero-lines >actual && |
5206d130 CR |
534 | git diff expect actual |
535 | ' | |
536 | ||
537 | echo 'tag line one' >annotagmsg | |
538 | echo 'tag line two' >>annotagmsg | |
539 | echo 'tag line three' >>annotagmsg | |
540 | test_expect_success \ | |
541 | 'listing many message lines of a non-signed tag should succeed' ' | |
542 | git-tag -F annotagmsg tag-lines && | |
543 | ||
544 | echo "tag-lines" >expect && | |
545 | git-tag -l | grep "^tag-lines" >actual && | |
546 | git diff expect actual && | |
c43a2483 | 547 | git-tag -n0 -l | grep "^tag-lines" >actual && |
5206d130 | 548 | git diff expect actual && |
c43a2483 | 549 | git-tag -n0 -l tag-lines >actual && |
5206d130 CR |
550 | git diff expect actual && |
551 | ||
552 | echo "tag-lines tag line one" >expect && | |
c43a2483 | 553 | git-tag -n1 -l | grep "^tag-lines" >actual && |
5206d130 CR |
554 | git diff expect actual && |
555 | git-tag -n -l | grep "^tag-lines" >actual && | |
556 | git diff expect actual && | |
c43a2483 | 557 | git-tag -n1 -l tag-lines >actual && |
5206d130 CR |
558 | git diff expect actual && |
559 | ||
560 | echo " tag line two" >>expect && | |
c43a2483 | 561 | git-tag -n2 -l | grep "^ *tag.line" >actual && |
5206d130 | 562 | git diff expect actual && |
c43a2483 | 563 | git-tag -n2 -l tag-lines >actual && |
5206d130 CR |
564 | git diff expect actual && |
565 | ||
566 | echo " tag line three" >>expect && | |
c43a2483 | 567 | git-tag -n3 -l | grep "^ *tag.line" >actual && |
5206d130 | 568 | git diff expect actual && |
c43a2483 | 569 | git-tag -n3 -l tag-lines >actual && |
5206d130 | 570 | git diff expect actual && |
c43a2483 | 571 | git-tag -n4 -l | grep "^ *tag.line" >actual && |
5206d130 | 572 | git diff expect actual && |
c43a2483 | 573 | git-tag -n4 -l tag-lines >actual && |
5206d130 | 574 | git diff expect actual && |
c43a2483 | 575 | git-tag -n99 -l | grep "^ *tag.line" >actual && |
5206d130 | 576 | git diff expect actual && |
c43a2483 | 577 | git-tag -n99 -l tag-lines >actual && |
5206d130 CR |
578 | git diff expect actual |
579 | ' | |
580 | ||
64fb19ba JS |
581 | # subsequent tests require gpg; check if it is available |
582 | gpg --version >/dev/null | |
583 | if [ $? -eq 127 ]; then | |
584 | echo "gpg not found - skipping tag signing and verification tests" | |
585 | test_done | |
586 | exit | |
587 | fi | |
588 | ||
ef5a6fb5 CR |
589 | # trying to verify annotated non-signed tags: |
590 | ||
591 | test_expect_success \ | |
592 | 'trying to verify an annotated non-signed tag should fail' ' | |
593 | tag_exists annotated-tag && | |
594 | ! git-tag -v annotated-tag | |
595 | ' | |
596 | ||
597 | test_expect_success \ | |
598 | 'trying to verify a file-annotated non-signed tag should fail' ' | |
599 | tag_exists file-annotated-tag && | |
600 | ! git-tag -v file-annotated-tag | |
601 | ' | |
602 | ||
62e09ce9 CR |
603 | test_expect_success \ |
604 | 'trying to verify two annotated non-signed tags should fail' ' | |
605 | tag_exists annotated-tag file-annotated-tag && | |
606 | ! git-tag -v annotated-tag file-annotated-tag | |
607 | ' | |
608 | ||
ef5a6fb5 CR |
609 | # creating and verifying signed tags: |
610 | ||
797e99a2 CR |
611 | # As said here: http://www.gnupg.org/documentation/faqs.html#q6.19 |
612 | # the gpg version 1.0.6 didn't parse trust packets correctly, so for | |
613 | # that version, creation of signed tags using the generated key fails. | |
614 | case "$(gpg --version)" in | |
615 | 'gpg (GnuPG) 1.0.6'*) | |
616 | echo "Skipping signed tag tests, because a bug in 1.0.6 version" | |
617 | test_done | |
618 | exit | |
619 | ;; | |
620 | esac | |
621 | ||
ef5a6fb5 CR |
622 | # key generation info: gpg --homedir t/t7004 --gen-key |
623 | # Type DSA and Elgamal, size 2048 bits, no expiration date. | |
624 | # Name and email: C O Mitter <committer@example.com> | |
625 | # No password given, to enable non-interactive operation. | |
626 | ||
627 | cp -R ../t7004 ./gpghome | |
628 | chmod 0700 gpghome | |
0e46e704 BD |
629 | GNUPGHOME="$(pwd)/gpghome" |
630 | export GNUPGHOME | |
ef5a6fb5 CR |
631 | |
632 | get_tag_header signed-tag $commit commit $time >expect | |
633 | echo 'A signed tag message' >>expect | |
634 | echo '-----BEGIN PGP SIGNATURE-----' >>expect | |
635 | test_expect_success 'creating a signed tag with -m message should succeed' ' | |
636 | git-tag -s -m "A signed tag message" signed-tag && | |
637 | get_tag_msg signed-tag >actual && | |
5be60078 | 638 | git diff expect actual |
ef5a6fb5 CR |
639 | ' |
640 | ||
be15f505 LT |
641 | get_tag_header u-signed-tag $commit commit $time >expect |
642 | echo 'Another message' >>expect | |
643 | echo '-----BEGIN PGP SIGNATURE-----' >>expect | |
644 | test_expect_success 'sign with a given key id' ' | |
645 | ||
646 | git tag -u committer@example.com -m "Another message" u-signed-tag && | |
647 | get_tag_msg u-signed-tag >actual && | |
648 | git diff expect actual | |
649 | ||
650 | ' | |
651 | ||
652 | test_expect_success 'sign with an unknown id (1)' ' | |
653 | ||
654 | ! git tag -u author@example.com -m "Another message" o-signed-tag | |
655 | ||
656 | ' | |
657 | ||
658 | test_expect_success 'sign with an unknown id (2)' ' | |
659 | ||
660 | ! git tag -u DEADBEEF -m "Another message" o-signed-tag | |
661 | ||
662 | ' | |
663 | ||
664 | cat >fakeeditor <<'EOF' | |
665 | #!/bin/sh | |
666 | test -n "$1" && exec >"$1" | |
667 | echo A signed tag message | |
668 | echo from a fake editor. | |
669 | EOF | |
670 | chmod +x fakeeditor | |
671 | ||
672 | get_tag_header implied-sign $commit commit $time >expect | |
673 | ./fakeeditor >>expect | |
674 | echo '-----BEGIN PGP SIGNATURE-----' >>expect | |
675 | test_expect_success '-u implies signed tag' ' | |
676 | GIT_EDITOR=./fakeeditor git-tag -u CDDE430D implied-sign && | |
677 | get_tag_msg implied-sign >actual && | |
678 | git diff expect actual | |
679 | ' | |
680 | ||
62e09ce9 CR |
681 | cat >sigmsgfile <<EOF |
682 | Another signed tag | |
683 | message in a file. | |
684 | EOF | |
685 | get_tag_header file-signed-tag $commit commit $time >expect | |
686 | cat sigmsgfile >>expect | |
687 | echo '-----BEGIN PGP SIGNATURE-----' >>expect | |
688 | test_expect_success \ | |
689 | 'creating a signed tag with -F messagefile should succeed' ' | |
690 | git-tag -s -F sigmsgfile file-signed-tag && | |
691 | get_tag_msg file-signed-tag >actual && | |
692 | git diff expect actual | |
693 | ' | |
694 | ||
695 | cat >siginputmsg <<EOF | |
696 | A signed tag message from | |
697 | the standard input | |
698 | EOF | |
699 | get_tag_header stdin-signed-tag $commit commit $time >expect | |
700 | cat siginputmsg >>expect | |
701 | echo '-----BEGIN PGP SIGNATURE-----' >>expect | |
702 | test_expect_success 'creating a signed tag with -F - should succeed' ' | |
703 | git-tag -s -F - stdin-signed-tag <siginputmsg && | |
704 | get_tag_msg stdin-signed-tag >actual && | |
705 | git diff expect actual | |
706 | ' | |
707 | ||
10507857 JK |
708 | get_tag_header implied-annotate $commit commit $time >expect |
709 | ./fakeeditor >>expect | |
710 | echo '-----BEGIN PGP SIGNATURE-----' >>expect | |
711 | test_expect_success '-s implies annotated tag' ' | |
712 | GIT_EDITOR=./fakeeditor git-tag -s implied-annotate && | |
713 | get_tag_msg implied-annotate >actual && | |
714 | git diff expect actual | |
715 | ' | |
716 | ||
e317cfaf CR |
717 | test_expect_success \ |
718 | 'trying to create a signed tag with non-existing -F file should fail' ' | |
719 | ! test -f nonexistingfile && | |
720 | ! tag_exists nosigtag && | |
721 | ! git-tag -s -F nonexistingfile nosigtag && | |
722 | ! tag_exists nosigtag | |
723 | ' | |
724 | ||
ef5a6fb5 CR |
725 | test_expect_success 'verifying a signed tag should succeed' \ |
726 | 'git-tag -v signed-tag' | |
727 | ||
62e09ce9 CR |
728 | test_expect_success 'verifying two signed tags in one command should succeed' \ |
729 | 'git-tag -v signed-tag file-signed-tag' | |
730 | ||
731 | test_expect_success \ | |
732 | 'verifying many signed and non-signed tags should fail' ' | |
733 | ! git-tag -v signed-tag annotated-tag && | |
734 | ! git-tag -v file-annotated-tag file-signed-tag && | |
735 | ! git-tag -v annotated-tag file-signed-tag file-annotated-tag && | |
736 | ! git-tag -v signed-tag annotated-tag file-signed-tag | |
737 | ' | |
738 | ||
ef5a6fb5 CR |
739 | test_expect_success 'verifying a forged tag should fail' ' |
740 | forged=$(git cat-file tag signed-tag | | |
741 | sed -e "s/signed-tag/forged-tag/" | | |
742 | git mktag) && | |
743 | git tag forged-tag $forged && | |
744 | ! git-tag -v forged-tag | |
745 | ' | |
746 | ||
747 | # blank and empty messages for signed tags: | |
748 | ||
749 | get_tag_header empty-signed-tag $commit commit $time >expect | |
750 | echo '-----BEGIN PGP SIGNATURE-----' >>expect | |
751 | test_expect_success \ | |
752 | 'creating a signed tag with an empty -m message should succeed' ' | |
753 | git-tag -s -m "" empty-signed-tag && | |
754 | get_tag_msg empty-signed-tag >actual && | |
755 | git diff expect actual && | |
756 | git-tag -v empty-signed-tag | |
757 | ' | |
758 | ||
759 | >sigemptyfile | |
760 | get_tag_header emptyfile-signed-tag $commit commit $time >expect | |
761 | echo '-----BEGIN PGP SIGNATURE-----' >>expect | |
762 | test_expect_success \ | |
763 | 'creating a signed tag with an empty -F messagefile should succeed' ' | |
764 | git-tag -s -F sigemptyfile emptyfile-signed-tag && | |
765 | get_tag_msg emptyfile-signed-tag >actual && | |
766 | git diff expect actual && | |
767 | git-tag -v emptyfile-signed-tag | |
768 | ' | |
769 | ||
770 | printf '\n\n \n\t\nLeading blank lines\n' > sigblanksfile | |
771 | printf '\n\t \t \nRepeated blank lines\n' >>sigblanksfile | |
772 | printf '\n\n\nTrailing spaces \t \n' >>sigblanksfile | |
773 | printf '\nTrailing blank lines\n\n\t \n\n' >>sigblanksfile | |
774 | get_tag_header blanks-signed-tag $commit commit $time >expect | |
775 | cat >>expect <<EOF | |
776 | Leading blank lines | |
777 | ||
778 | Repeated blank lines | |
779 | ||
780 | Trailing spaces | |
781 | ||
782 | Trailing blank lines | |
783 | EOF | |
784 | echo '-----BEGIN PGP SIGNATURE-----' >>expect | |
785 | test_expect_success \ | |
786 | 'extra blanks in the message for a signed tag should be removed' ' | |
787 | git-tag -s -F sigblanksfile blanks-signed-tag && | |
788 | get_tag_msg blanks-signed-tag >actual && | |
789 | git diff expect actual && | |
790 | git-tag -v blanks-signed-tag | |
791 | ' | |
792 | ||
793 | get_tag_header blank-signed-tag $commit commit $time >expect | |
794 | echo '-----BEGIN PGP SIGNATURE-----' >>expect | |
795 | test_expect_success \ | |
796 | 'creating a signed tag with a blank -m message should succeed' ' | |
797 | git-tag -s -m " " blank-signed-tag && | |
798 | get_tag_msg blank-signed-tag >actual && | |
799 | git diff expect actual && | |
800 | git-tag -v blank-signed-tag | |
801 | ' | |
802 | ||
803 | echo ' ' >sigblankfile | |
804 | echo '' >>sigblankfile | |
805 | echo ' ' >>sigblankfile | |
806 | get_tag_header blankfile-signed-tag $commit commit $time >expect | |
807 | echo '-----BEGIN PGP SIGNATURE-----' >>expect | |
808 | test_expect_success \ | |
809 | 'creating a signed tag with blank -F file with spaces should succeed' ' | |
810 | git-tag -s -F sigblankfile blankfile-signed-tag && | |
811 | get_tag_msg blankfile-signed-tag >actual && | |
812 | git diff expect actual && | |
813 | git-tag -v blankfile-signed-tag | |
814 | ' | |
815 | ||
816 | printf ' ' >sigblanknonlfile | |
817 | get_tag_header blanknonlfile-signed-tag $commit commit $time >expect | |
818 | echo '-----BEGIN PGP SIGNATURE-----' >>expect | |
819 | test_expect_success \ | |
820 | 'creating a signed tag with spaces and no newline should succeed' ' | |
821 | git-tag -s -F sigblanknonlfile blanknonlfile-signed-tag && | |
822 | get_tag_msg blanknonlfile-signed-tag >actual && | |
823 | git diff expect actual && | |
824 | git-tag -v signed-tag | |
825 | ' | |
826 | ||
827 | # messages with commented lines for signed tags: | |
828 | ||
829 | cat >sigcommentsfile <<EOF | |
830 | # A comment | |
831 | ||
832 | ############ | |
833 | The message. | |
834 | ############ | |
835 | One line. | |
836 | ||
837 | ||
838 | # commented lines | |
839 | # commented lines | |
840 | ||
841 | Another line. | |
842 | # comments | |
843 | ||
844 | Last line. | |
845 | EOF | |
846 | get_tag_header comments-signed-tag $commit commit $time >expect | |
847 | cat >>expect <<EOF | |
848 | The message. | |
849 | One line. | |
850 | ||
851 | Another line. | |
852 | ||
853 | Last line. | |
854 | EOF | |
855 | echo '-----BEGIN PGP SIGNATURE-----' >>expect | |
856 | test_expect_success \ | |
857 | 'creating a signed tag with a -F file with #comments should succeed' ' | |
858 | git-tag -s -F sigcommentsfile comments-signed-tag && | |
859 | get_tag_msg comments-signed-tag >actual && | |
860 | git diff expect actual && | |
861 | git-tag -v comments-signed-tag | |
862 | ' | |
863 | ||
864 | get_tag_header comment-signed-tag $commit commit $time >expect | |
865 | echo '-----BEGIN PGP SIGNATURE-----' >>expect | |
866 | test_expect_success \ | |
867 | 'creating a signed tag with #commented -m message should succeed' ' | |
868 | git-tag -s -m "#comment" comment-signed-tag && | |
869 | get_tag_msg comment-signed-tag >actual && | |
870 | git diff expect actual && | |
871 | git-tag -v comment-signed-tag | |
872 | ' | |
873 | ||
874 | echo '#comment' >sigcommentfile | |
875 | echo '' >>sigcommentfile | |
876 | echo '####' >>sigcommentfile | |
877 | get_tag_header commentfile-signed-tag $commit commit $time >expect | |
878 | echo '-----BEGIN PGP SIGNATURE-----' >>expect | |
879 | test_expect_success \ | |
880 | 'creating a signed tag with #commented -F messagefile should succeed' ' | |
881 | git-tag -s -F sigcommentfile commentfile-signed-tag && | |
882 | get_tag_msg commentfile-signed-tag >actual && | |
883 | git diff expect actual && | |
884 | git-tag -v commentfile-signed-tag | |
885 | ' | |
886 | ||
887 | printf '#comment' >sigcommentnonlfile | |
888 | get_tag_header commentnonlfile-signed-tag $commit commit $time >expect | |
889 | echo '-----BEGIN PGP SIGNATURE-----' >>expect | |
890 | test_expect_success \ | |
891 | 'creating a signed tag with a #comment and no newline should succeed' ' | |
892 | git-tag -s -F sigcommentnonlfile commentnonlfile-signed-tag && | |
893 | get_tag_msg commentnonlfile-signed-tag >actual && | |
894 | git diff expect actual && | |
895 | git-tag -v commentnonlfile-signed-tag | |
896 | ' | |
897 | ||
5206d130 CR |
898 | # listing messages for signed tags: |
899 | ||
900 | test_expect_success \ | |
901 | 'listing the one-line message of a signed tag should succeed' ' | |
902 | git-tag -s -m "A message line signed" stag-one-line && | |
903 | ||
904 | echo "stag-one-line" >expect && | |
905 | git-tag -l | grep "^stag-one-line" >actual && | |
906 | git diff expect actual && | |
c43a2483 | 907 | git-tag -n0 -l | grep "^stag-one-line" >actual && |
5206d130 | 908 | git diff expect actual && |
c43a2483 | 909 | git-tag -n0 -l stag-one-line >actual && |
5206d130 CR |
910 | git diff expect actual && |
911 | ||
912 | echo "stag-one-line A message line signed" >expect && | |
c43a2483 | 913 | git-tag -n1 -l | grep "^stag-one-line" >actual && |
5206d130 CR |
914 | git diff expect actual && |
915 | git-tag -n -l | grep "^stag-one-line" >actual && | |
916 | git diff expect actual && | |
c43a2483 | 917 | git-tag -n1 -l stag-one-line >actual && |
5206d130 | 918 | git diff expect actual && |
c43a2483 | 919 | git-tag -n2 -l stag-one-line >actual && |
5206d130 | 920 | git diff expect actual && |
c43a2483 | 921 | git-tag -n999 -l stag-one-line >actual && |
5206d130 CR |
922 | git diff expect actual |
923 | ' | |
924 | ||
925 | test_expect_success \ | |
926 | 'listing the zero-lines message of a signed tag should succeed' ' | |
927 | git-tag -s -m "" stag-zero-lines && | |
928 | ||
929 | echo "stag-zero-lines" >expect && | |
930 | git-tag -l | grep "^stag-zero-lines" >actual && | |
931 | git diff expect actual && | |
c43a2483 | 932 | git-tag -n0 -l | grep "^stag-zero-lines" >actual && |
5206d130 | 933 | git diff expect actual && |
c43a2483 | 934 | git-tag -n0 -l stag-zero-lines >actual && |
5206d130 CR |
935 | git diff expect actual && |
936 | ||
937 | echo "stag-zero-lines " >expect && | |
c43a2483 | 938 | git-tag -n1 -l | grep "^stag-zero-lines" >actual && |
5206d130 CR |
939 | git diff expect actual && |
940 | git-tag -n -l | grep "^stag-zero-lines" >actual && | |
941 | git diff expect actual && | |
c43a2483 | 942 | git-tag -n1 -l stag-zero-lines >actual && |
5206d130 | 943 | git diff expect actual && |
c43a2483 | 944 | git-tag -n2 -l stag-zero-lines >actual && |
5206d130 | 945 | git diff expect actual && |
c43a2483 | 946 | git-tag -n999 -l stag-zero-lines >actual && |
5206d130 CR |
947 | git diff expect actual |
948 | ' | |
949 | ||
950 | echo 'stag line one' >sigtagmsg | |
951 | echo 'stag line two' >>sigtagmsg | |
952 | echo 'stag line three' >>sigtagmsg | |
953 | test_expect_success \ | |
954 | 'listing many message lines of a signed tag should succeed' ' | |
955 | git-tag -s -F sigtagmsg stag-lines && | |
956 | ||
957 | echo "stag-lines" >expect && | |
958 | git-tag -l | grep "^stag-lines" >actual && | |
959 | git diff expect actual && | |
c43a2483 | 960 | git-tag -n0 -l | grep "^stag-lines" >actual && |
5206d130 | 961 | git diff expect actual && |
c43a2483 | 962 | git-tag -n0 -l stag-lines >actual && |
5206d130 CR |
963 | git diff expect actual && |
964 | ||
965 | echo "stag-lines stag line one" >expect && | |
c43a2483 | 966 | git-tag -n1 -l | grep "^stag-lines" >actual && |
5206d130 CR |
967 | git diff expect actual && |
968 | git-tag -n -l | grep "^stag-lines" >actual && | |
969 | git diff expect actual && | |
c43a2483 | 970 | git-tag -n1 -l stag-lines >actual && |
5206d130 CR |
971 | git diff expect actual && |
972 | ||
973 | echo " stag line two" >>expect && | |
c43a2483 | 974 | git-tag -n2 -l | grep "^ *stag.line" >actual && |
5206d130 | 975 | git diff expect actual && |
c43a2483 | 976 | git-tag -n2 -l stag-lines >actual && |
5206d130 CR |
977 | git diff expect actual && |
978 | ||
979 | echo " stag line three" >>expect && | |
c43a2483 | 980 | git-tag -n3 -l | grep "^ *stag.line" >actual && |
5206d130 | 981 | git diff expect actual && |
c43a2483 | 982 | git-tag -n3 -l stag-lines >actual && |
5206d130 | 983 | git diff expect actual && |
c43a2483 | 984 | git-tag -n4 -l | grep "^ *stag.line" >actual && |
5206d130 | 985 | git diff expect actual && |
c43a2483 | 986 | git-tag -n4 -l stag-lines >actual && |
5206d130 | 987 | git diff expect actual && |
c43a2483 | 988 | git-tag -n99 -l | grep "^ *stag.line" >actual && |
5206d130 | 989 | git diff expect actual && |
c43a2483 | 990 | git-tag -n99 -l stag-lines >actual && |
5206d130 CR |
991 | git diff expect actual |
992 | ' | |
993 | ||
ef5a6fb5 CR |
994 | # tags pointing to objects different from commits: |
995 | ||
996 | tree=$(git rev-parse HEAD^{tree}) | |
997 | blob=$(git rev-parse HEAD:foo) | |
998 | tag=$(git rev-parse signed-tag) | |
999 | ||
1000 | get_tag_header tree-signed-tag $tree tree $time >expect | |
1001 | echo "A message for a tree" >>expect | |
1002 | echo '-----BEGIN PGP SIGNATURE-----' >>expect | |
1003 | test_expect_success \ | |
1004 | 'creating a signed tag pointing to a tree should succeed' ' | |
1005 | git-tag -s -m "A message for a tree" tree-signed-tag HEAD^{tree} && | |
1006 | get_tag_msg tree-signed-tag >actual && | |
1007 | git diff expect actual | |
1008 | ' | |
1009 | ||
1010 | get_tag_header blob-signed-tag $blob blob $time >expect | |
1011 | echo "A message for a blob" >>expect | |
1012 | echo '-----BEGIN PGP SIGNATURE-----' >>expect | |
1013 | test_expect_success \ | |
1014 | 'creating a signed tag pointing to a blob should succeed' ' | |
1015 | git-tag -s -m "A message for a blob" blob-signed-tag HEAD:foo && | |
1016 | get_tag_msg blob-signed-tag >actual && | |
1017 | git diff expect actual | |
1018 | ' | |
1019 | ||
1020 | get_tag_header tag-signed-tag $tag tag $time >expect | |
1021 | echo "A message for another tag" >>expect | |
1022 | echo '-----BEGIN PGP SIGNATURE-----' >>expect | |
1023 | test_expect_success \ | |
1024 | 'creating a signed tag pointing to another tag should succeed' ' | |
1025 | git-tag -s -m "A message for another tag" tag-signed-tag signed-tag && | |
1026 | get_tag_msg tag-signed-tag >actual && | |
1027 | git diff expect actual | |
1028 | ' | |
1029 | ||
aba91192 CR |
1030 | # try to sign with bad user.signingkey |
1031 | git config user.signingkey BobTheMouse | |
41ac414e | 1032 | test_expect_success \ |
aba91192 | 1033 | 'git-tag -s fails if gpg is misconfigured' \ |
41ac414e | 1034 | '! git tag -s -m tail tag-gpg-failure' |
aba91192 CR |
1035 | git config --unset user.signingkey |
1036 | ||
ef5a6fb5 CR |
1037 | # try to verify without gpg: |
1038 | ||
1039 | rm -rf gpghome | |
41ac414e | 1040 | test_expect_success \ |
ef5a6fb5 | 1041 | 'verify signed tag fails when public key is not present' \ |
41ac414e | 1042 | '! git-tag -v signed-tag' |
ef5a6fb5 | 1043 | |
41ac414e | 1044 | test_expect_success \ |
eb9d2b91 | 1045 | 'git-tag -a fails if tag annotation is empty' ' |
41ac414e | 1046 | ! (GIT_EDITOR=cat git tag -a initial-comment) |
eb9d2b91 MH |
1047 | ' |
1048 | ||
4d8b1dc8 MH |
1049 | test_expect_success \ |
1050 | 'message in editor has initial comment' ' | |
eb9d2b91 MH |
1051 | GIT_EDITOR=cat git tag -a initial-comment > actual |
1052 | # check the first line --- should be empty | |
1053 | first=$(sed -e 1q <actual) && | |
1054 | test -z "$first" && | |
1055 | # remove commented lines from the remainder -- should be empty | |
1056 | rest=$(sed -e 1d -e '/^#/d' <actual) && | |
1057 | test -z "$rest" | |
4d8b1dc8 MH |
1058 | ' |
1059 | ||
1060 | get_tag_header reuse $commit commit $time >expect | |
1061 | echo "An annotation to be reused" >> expect | |
1062 | test_expect_success \ | |
1063 | 'overwriting an annoted tag should use its previous body' ' | |
1064 | git tag -a -m "An annotation to be reused" reuse && | |
1065 | GIT_EDITOR=true git tag -f -a reuse && | |
1066 | get_tag_msg reuse >actual && | |
1067 | git diff expect actual | |
1068 | ' | |
1069 | ||
ef5a6fb5 | 1070 | test_done |