3 test_description
='check tg tag reflog operations'
9 TZ
=PST8PDT
&& export TZ || die
11 if vcmp
"$git_version" '>=' "2.5"; then
12 test_set_prereq
"GIT_2_5"
16 if vcmp
"$git_version" '>=' "2.31"; then
23 _gt
="$(git mktree </dev/null)" &&
25 _gc
="$(git commit-tree -m "$
*" "$_gt")" &&
26 git update-ref HEAD
"$_gc" ""
30 _gt
="$(git write-tree)" &&
32 _gc
="$(git commit-tree -m "$
*" "$_gt")" &&
33 git update-ref HEAD
"$_gc" HEAD
36 # replace `git symbolic-ref HEAD refs/heads/foo`
37 # with `sane_reattach_ref HEAD refs/heads/foo`
39 _rlc
="$(git reflog show "$1" -- | wc -l)" &&
40 git symbolic-ref
"$1" "$2" &&
41 _rlc2
="$(git reflog show "$1" -- | wc -l)" &&
42 if test x
"$_rlc" != x
"$_rlc2"; then
43 git reflog delete
"$1@{0}" &&
44 _rlc2
="$(git reflog show "$1" -- | wc -l)" &&
45 test x
"$_rlc" = x
"$_rlc2"
49 test_expect_success
'setup main' '
50 test_create_repo main &&
52 git config core.abbrev 8 &&
53 git config log.decorate 0 &&
54 commit_empty_root "empty" &&
55 mtcommit="$(git rev-parse --verify HEAD)" && test -n "$mtcommit" &&
56 test_when_finished mtcommit="$mtcommit" &&
59 commit_orphan "file 1" &&
60 git read-tree --empty &&
62 hash2="$(git hash-object -w --stdin -t blob <file2)" && test -n "$hash2" &&
63 test_when_finished hash2="$hash2" &&
65 commit_orphan "file 2" &&
66 git read-tree --empty &&
69 commit_orphan "file 3" &&
70 git read-tree --empty &&
73 commit_orphan "file 4" &&
74 c4="$(git rev-parse --verify HEAD)" && test -n "$c4" &&
75 git read-tree --empty &&
77 hash5="$(git hash-object -w --stdin -t blob <file5)" && test -n "$hash5" &&
78 test_when_finished hash5="$hash5" &&
80 commit_orphan "file 5" &&
81 git read-tree --empty &&
84 commit_orphan "file 6" &&
85 git read-tree --empty &&
88 commit_orphan "file 7" &&
89 c7="$(git rev-parse --verify HEAD)" && test -n "$c7" &&
90 git update-ref --no-deref -m "detaching to c4" HEAD "$c4" HEAD &&
91 git update-ref --no-deref -m "attaching back to c7" HEAD "$c7" HEAD &&
92 sane_reattach_ref HEAD refs/heads/master &&
93 echo "$hash2" >objs &&
94 echo "$hash5" >>objs &&
95 pack="$(git pack-objects <objs .git/objects/pack/pack)" && test -n "$pack" &&
96 test -s ".git/objects/pack/pack-$pack.idx" &&
97 test -s ".git/objects/pack/pack-$pack.pack" &&
100 test_when_finished objpack="pack-$pack"
103 test_expect_success
'LASTOK GIT_2_5' 'setup linked' '
104 git --git-dir=main/.git worktree add -b linked linked "$mtcommit" &&
106 # there will be a HEAD@{0} now and there might be a HEAD@{1}
107 # account for both so this test does not break if it ever gets fixed
108 test_might_fail git reflog delete HEAD@{1} &&
109 test_might_fail git reflog delete HEAD@{0} &&
110 git update-ref -d refs/heads/linked &&
111 commit_empty_root "empty linked" &&
112 # get rid of "magic" HEAD ref log entry added because its symref was deleted
113 test_might_fail git reflog delete HEAD@{1} &&
114 git read-tree --empty &&
117 commit_orphan "file 7" &&
118 git read-tree --empty &&
121 commit_orphan "file 6" &&
122 git read-tree --empty &&
125 commit_orphan "file 5" &&
126 git read-tree --empty &&
129 commit_orphan "file 4" &&
130 c4="$(git rev-parse --verify HEAD)" && test -n "$c4" &&
131 git read-tree --empty &&
134 commit_orphan "file 3" &&
135 git read-tree --empty &&
138 commit_orphan "file 2" &&
139 git read-tree --empty &&
142 commit_orphan "file 1" &&
143 c1="$(git rev-parse --verify HEAD)" && test -n "$c1" &&
144 git update-ref --no-deref -m "detaching to linked c4" HEAD "$c4" HEAD &&
145 git update-ref --no-deref -m "attaching back to linked c1" HEAD "$c1" HEAD &&
146 sane_reattach_ref HEAD refs/heads/linked
149 test "$test_hash_algo" != "sha1" ||
150 cat <<\EOT
>HEAD_main.log || die
151 commit dd1016e3aedddb592ab8b1075dc5957c2c770c57
152 Reflog
: HEAD@
{0} (Fra mewor k
(Committer
) <framework@example.org
>)
153 Reflog message
: attaching back to c7
154 Author
: Te s t
(Author
) <test@example.net
>
155 AuthorDate
: Thu Apr
7 15:20:13 2005 -0700
156 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
157 CommitDate
: Thu Apr
7 15:20:13 2005 -0700
161 commit
40403e00fa16ee338d54ab86d67dde8b8017312d
162 Reflog
: HEAD@
{1} (Fra mewor k
(Committer
) <framework@example.org
>)
163 Reflog message
: detaching to c4
164 Author
: Te s t
(Author
) <test@example.net
>
165 AuthorDate
: Thu Apr
7 15:17:13 2005 -0700
166 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
167 CommitDate
: Thu Apr
7 15:17:13 2005 -0700
171 commit dd1016e3aedddb592ab8b1075dc5957c2c770c57
172 Reflog
: HEAD@
{2} (Fra mewor k
(Committer
) <framework@example.org
>)
174 Author
: Te s t
(Author
) <test@example.net
>
175 AuthorDate
: Thu Apr
7 15:20:13 2005 -0700
176 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
177 CommitDate
: Thu Apr
7 15:20:13 2005 -0700
181 commit
84b1e4e6dd88903b38db5c1e41bcb048abafa044
182 Reflog
: HEAD@
{3} (Fra mewor k
(Committer
) <framework@example.org
>)
184 Author
: Te s t
(Author
) <test@example.net
>
185 AuthorDate
: Thu Apr
7 15:19:13 2005 -0700
186 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
187 CommitDate
: Thu Apr
7 15:19:13 2005 -0700
191 commit
8238c7e733e43fb89537cf4cae44d31a5438acd6
192 Reflog
: HEAD@
{4} (Fra mewor k
(Committer
) <framework@example.org
>)
194 Author
: Te s t
(Author
) <test@example.net
>
195 AuthorDate
: Thu Apr
7 15:18:13 2005 -0700
196 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
197 CommitDate
: Thu Apr
7 15:18:13 2005 -0700
201 commit
40403e00fa16ee338d54ab86d67dde8b8017312d
202 Reflog
: HEAD@
{5} (Fra mewor k
(Committer
) <framework@example.org
>)
204 Author
: Te s t
(Author
) <test@example.net
>
205 AuthorDate
: Thu Apr
7 15:17:13 2005 -0700
206 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
207 CommitDate
: Thu Apr
7 15:17:13 2005 -0700
211 commit feeb764a0c96556642f118177871e09693a1ea2c
212 Reflog
: HEAD@
{6} (Fra mewor k
(Committer
) <framework@example.org
>)
214 Author
: Te s t
(Author
) <test@example.net
>
215 AuthorDate
: Thu Apr
7 15:16:13 2005 -0700
216 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
217 CommitDate
: Thu Apr
7 15:16:13 2005 -0700
221 commit c0ed6e70c9c2edcaa98118b9c26a98e4f9beba3c
222 Reflog
: HEAD@
{7} (Fra mewor k
(Committer
) <framework@example.org
>)
224 Author
: Te s t
(Author
) <test@example.net
>
225 AuthorDate
: Thu Apr
7 15:15:13 2005 -0700
226 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
227 CommitDate
: Thu Apr
7 15:15:13 2005 -0700
231 commit c18fcef2dd73f7969b45b108d061309b670c886c
232 Reflog
: HEAD@
{8} (Fra mewor k
(Committer
) <framework@example.org
>)
234 Author
: Te s t
(Author
) <test@example.net
>
235 AuthorDate
: Thu Apr
7 15:14:13 2005 -0700
236 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
237 CommitDate
: Thu Apr
7 15:14:13 2005 -0700
241 commit b63866e540ea13ef92d9eaad23c571912019da41
242 Reflog
: HEAD@
{9} (Fra mewor k
(Committer
) <framework@example.org
>)
244 Author
: Te s t
(Author
) <test@example.net
>
245 AuthorDate
: Thu Apr
7 15:13:13 2005 -0700
246 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
247 CommitDate
: Thu Apr
7 15:13:13 2005 -0700
252 test "$test_hash_algo" != "sha1" ||
253 cat <<\EOT
>HEAD_linked.log || die
254 commit
04eea982f4572b35c7cbb6597f5d777661f15e60
255 Reflog
: HEAD@
{0} (Fra mewor k
(Committer
) <framework@example.org
>)
256 Reflog message
: attaching back to linked c1
257 Author
: Te s t
(Author
) <test@example.net
>
258 AuthorDate
: Thu Apr
7 15:20:13 2005 -0700
259 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
260 CommitDate
: Thu Apr
7 15:20:13 2005 -0700
264 commit
40403e00fa16ee338d54ab86d67dde8b8017312d
265 Reflog
: HEAD@
{1} (Fra mewor k
(Committer
) <framework@example.org
>)
266 Reflog message
: detaching to linked c4
267 Author
: Te s t
(Author
) <test@example.net
>
268 AuthorDate
: Thu Apr
7 15:17:13 2005 -0700
269 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
270 CommitDate
: Thu Apr
7 15:17:13 2005 -0700
274 commit
04eea982f4572b35c7cbb6597f5d777661f15e60
275 Reflog
: HEAD@
{2} (Fra mewor k
(Committer
) <framework@example.org
>)
277 Author
: Te s t
(Author
) <test@example.net
>
278 AuthorDate
: Thu Apr
7 15:20:13 2005 -0700
279 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
280 CommitDate
: Thu Apr
7 15:20:13 2005 -0700
284 commit
4d776c6492d2e482e7d5a7673eec6a003e1f2f28
285 Reflog
: HEAD@
{3} (Fra mewor k
(Committer
) <framework@example.org
>)
287 Author
: Te s t
(Author
) <test@example.net
>
288 AuthorDate
: Thu Apr
7 15:19:13 2005 -0700
289 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
290 CommitDate
: Thu Apr
7 15:19:13 2005 -0700
294 commit
602d59a7ea59e60a4776c39f5cefde1e250e7e21
295 Reflog
: HEAD@
{4} (Fra mewor k
(Committer
) <framework@example.org
>)
297 Author
: Te s t
(Author
) <test@example.net
>
298 AuthorDate
: Thu Apr
7 15:18:13 2005 -0700
299 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
300 CommitDate
: Thu Apr
7 15:18:13 2005 -0700
304 commit
40403e00fa16ee338d54ab86d67dde8b8017312d
305 Reflog
: HEAD@
{5} (Fra mewor k
(Committer
) <framework@example.org
>)
307 Author
: Te s t
(Author
) <test@example.net
>
308 AuthorDate
: Thu Apr
7 15:17:13 2005 -0700
309 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
310 CommitDate
: Thu Apr
7 15:17:13 2005 -0700
314 commit
0a45d4757beafde42dba7b9e228f4fca4d2c2570
315 Reflog
: HEAD@
{6} (Fra mewor k
(Committer
) <framework@example.org
>)
317 Author
: Te s t
(Author
) <test@example.net
>
318 AuthorDate
: Thu Apr
7 15:16:13 2005 -0700
319 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
320 CommitDate
: Thu Apr
7 15:16:13 2005 -0700
324 commit e053b7d1bf32cbf73d07ebccef4f717375b27af8
325 Reflog
: HEAD@
{7} (Fra mewor k
(Committer
) <framework@example.org
>)
327 Author
: Te s t
(Author
) <test@example.net
>
328 AuthorDate
: Thu Apr
7 15:15:13 2005 -0700
329 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
330 CommitDate
: Thu Apr
7 15:15:13 2005 -0700
334 commit
2849f113c66cbf3c9521e90be3bc7e39fce8db16
335 Reflog
: HEAD@
{8} (Fra mewor k
(Committer
) <framework@example.org
>)
337 Author
: Te s t
(Author
) <test@example.net
>
338 AuthorDate
: Thu Apr
7 15:14:13 2005 -0700
339 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
340 CommitDate
: Thu Apr
7 15:14:13 2005 -0700
344 commit fce870c7720ff513ea5dd3c60d6972ed70c41d1f
345 Reflog
: HEAD@
{9} (Fra mewor k
(Committer
) <framework@example.org
>)
347 Author
: Te s t
(Author
) <test@example.net
>
348 AuthorDate
: Thu Apr
7 15:13:13 2005 -0700
349 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
350 CommitDate
: Thu Apr
7 15:13:13 2005 -0700
355 test "$test_hash_algo" != "sha1" ||
356 cat <<\EOT
>master.log
357 commit dd1016e3aedddb592ab8b1075dc5957c2c770c57
358 Reflog
: master@
{0} (Fra mewor k
(Committer
) <framework@example.org
>)
360 Author
: Te s t
(Author
) <test@example.net
>
361 AuthorDate
: Thu Apr
7 15:20:13 2005 -0700
362 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
363 CommitDate
: Thu Apr
7 15:20:13 2005 -0700
367 commit
84b1e4e6dd88903b38db5c1e41bcb048abafa044
368 Reflog
: master@
{1} (Fra mewor k
(Committer
) <framework@example.org
>)
370 Author
: Te s t
(Author
) <test@example.net
>
371 AuthorDate
: Thu Apr
7 15:19:13 2005 -0700
372 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
373 CommitDate
: Thu Apr
7 15:19:13 2005 -0700
377 commit
8238c7e733e43fb89537cf4cae44d31a5438acd6
378 Reflog
: master@
{2} (Fra mewor k
(Committer
) <framework@example.org
>)
380 Author
: Te s t
(Author
) <test@example.net
>
381 AuthorDate
: Thu Apr
7 15:18:13 2005 -0700
382 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
383 CommitDate
: Thu Apr
7 15:18:13 2005 -0700
387 commit
40403e00fa16ee338d54ab86d67dde8b8017312d
388 Reflog
: master@
{3} (Fra mewor k
(Committer
) <framework@example.org
>)
390 Author
: Te s t
(Author
) <test@example.net
>
391 AuthorDate
: Thu Apr
7 15:17:13 2005 -0700
392 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
393 CommitDate
: Thu Apr
7 15:17:13 2005 -0700
397 commit feeb764a0c96556642f118177871e09693a1ea2c
398 Reflog
: master@
{4} (Fra mewor k
(Committer
) <framework@example.org
>)
400 Author
: Te s t
(Author
) <test@example.net
>
401 AuthorDate
: Thu Apr
7 15:16:13 2005 -0700
402 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
403 CommitDate
: Thu Apr
7 15:16:13 2005 -0700
407 commit c0ed6e70c9c2edcaa98118b9c26a98e4f9beba3c
408 Reflog
: master@
{5} (Fra mewor k
(Committer
) <framework@example.org
>)
410 Author
: Te s t
(Author
) <test@example.net
>
411 AuthorDate
: Thu Apr
7 15:15:13 2005 -0700
412 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
413 CommitDate
: Thu Apr
7 15:15:13 2005 -0700
417 commit c18fcef2dd73f7969b45b108d061309b670c886c
418 Reflog
: master@
{6} (Fra mewor k
(Committer
) <framework@example.org
>)
420 Author
: Te s t
(Author
) <test@example.net
>
421 AuthorDate
: Thu Apr
7 15:14:13 2005 -0700
422 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
423 CommitDate
: Thu Apr
7 15:14:13 2005 -0700
427 commit b63866e540ea13ef92d9eaad23c571912019da41
428 Reflog
: master@
{7} (Fra mewor k
(Committer
) <framework@example.org
>)
430 Author
: Te s t
(Author
) <test@example.net
>
431 AuthorDate
: Thu Apr
7 15:13:13 2005 -0700
432 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
433 CommitDate
: Thu Apr
7 15:13:13 2005 -0700
438 test "$test_hash_algo" != "sha1" ||
439 cat <<\EOT
>linked.log
440 commit
04eea982f4572b35c7cbb6597f5d777661f15e60
441 Reflog
: linked@
{0} (Fra mewor k
(Committer
) <framework@example.org
>)
443 Author
: Te s t
(Author
) <test@example.net
>
444 AuthorDate
: Thu Apr
7 15:20:13 2005 -0700
445 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
446 CommitDate
: Thu Apr
7 15:20:13 2005 -0700
450 commit
4d776c6492d2e482e7d5a7673eec6a003e1f2f28
451 Reflog
: linked@
{1} (Fra mewor k
(Committer
) <framework@example.org
>)
453 Author
: Te s t
(Author
) <test@example.net
>
454 AuthorDate
: Thu Apr
7 15:19:13 2005 -0700
455 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
456 CommitDate
: Thu Apr
7 15:19:13 2005 -0700
460 commit
602d59a7ea59e60a4776c39f5cefde1e250e7e21
461 Reflog
: linked@
{2} (Fra mewor k
(Committer
) <framework@example.org
>)
463 Author
: Te s t
(Author
) <test@example.net
>
464 AuthorDate
: Thu Apr
7 15:18:13 2005 -0700
465 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
466 CommitDate
: Thu Apr
7 15:18:13 2005 -0700
470 commit
40403e00fa16ee338d54ab86d67dde8b8017312d
471 Reflog
: linked@
{3} (Fra mewor k
(Committer
) <framework@example.org
>)
473 Author
: Te s t
(Author
) <test@example.net
>
474 AuthorDate
: Thu Apr
7 15:17:13 2005 -0700
475 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
476 CommitDate
: Thu Apr
7 15:17:13 2005 -0700
480 commit
0a45d4757beafde42dba7b9e228f4fca4d2c2570
481 Reflog
: linked@
{4} (Fra mewor k
(Committer
) <framework@example.org
>)
483 Author
: Te s t
(Author
) <test@example.net
>
484 AuthorDate
: Thu Apr
7 15:16:13 2005 -0700
485 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
486 CommitDate
: Thu Apr
7 15:16:13 2005 -0700
490 commit e053b7d1bf32cbf73d07ebccef4f717375b27af8
491 Reflog
: linked@
{5} (Fra mewor k
(Committer
) <framework@example.org
>)
493 Author
: Te s t
(Author
) <test@example.net
>
494 AuthorDate
: Thu Apr
7 15:15:13 2005 -0700
495 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
496 CommitDate
: Thu Apr
7 15:15:13 2005 -0700
500 commit
2849f113c66cbf3c9521e90be3bc7e39fce8db16
501 Reflog
: linked@
{6} (Fra mewor k
(Committer
) <framework@example.org
>)
503 Author
: Te s t
(Author
) <test@example.net
>
504 AuthorDate
: Thu Apr
7 15:14:13 2005 -0700
505 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
506 CommitDate
: Thu Apr
7 15:14:13 2005 -0700
510 commit fce870c7720ff513ea5dd3c60d6972ed70c41d1f
511 Reflog
: linked@
{7} (Fra mewor k
(Committer
) <framework@example.org
>)
513 Author
: Te s t
(Author
) <test@example.net
>
514 AuthorDate
: Thu Apr
7 15:13:13 2005 -0700
515 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
516 CommitDate
: Thu Apr
7 15:13:13 2005 -0700
521 test "$test_hash_algo" != "sha256" ||
522 cat <<\EOT
>HEAD_main.log || die
523 commit e784e427bc756c7dab3c5c993ce172605b03911f4a4cee2b472f5eaf47439f1f
524 Reflog
: HEAD@
{0} (Fra mewor k
(Committer
) <framework@example.org
>)
525 Reflog message
: attaching back to c7
526 Author
: Te s t
(Author
) <test@example.net
>
527 AuthorDate
: Thu Apr
7 15:20:13 2005 -0700
528 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
529 CommitDate
: Thu Apr
7 15:20:13 2005 -0700
533 commit e2552eeb08597fac52b221ecdcdda3d73b298adf066bd68a75e6d78b5c3ae0a8
534 Reflog
: HEAD@
{1} (Fra mewor k
(Committer
) <framework@example.org
>)
535 Reflog message
: detaching to c4
536 Author
: Te s t
(Author
) <test@example.net
>
537 AuthorDate
: Thu Apr
7 15:17:13 2005 -0700
538 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
539 CommitDate
: Thu Apr
7 15:17:13 2005 -0700
543 commit e784e427bc756c7dab3c5c993ce172605b03911f4a4cee2b472f5eaf47439f1f
544 Reflog
: HEAD@
{2} (Fra mewor k
(Committer
) <framework@example.org
>)
546 Author
: Te s t
(Author
) <test@example.net
>
547 AuthorDate
: Thu Apr
7 15:20:13 2005 -0700
548 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
549 CommitDate
: Thu Apr
7 15:20:13 2005 -0700
553 commit
201a80d1dac354e3bf8f5ffd8d6ed3bf45425d25903e51c5b5fe581ed1915b2b
554 Reflog
: HEAD@
{3} (Fra mewor k
(Committer
) <framework@example.org
>)
556 Author
: Te s t
(Author
) <test@example.net
>
557 AuthorDate
: Thu Apr
7 15:19:13 2005 -0700
558 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
559 CommitDate
: Thu Apr
7 15:19:13 2005 -0700
563 commit
71acff480527a965010d8d59c50ed31ccff26637eb259ecd29aeb48f90dbcbd6
564 Reflog
: HEAD@
{4} (Fra mewor k
(Committer
) <framework@example.org
>)
566 Author
: Te s t
(Author
) <test@example.net
>
567 AuthorDate
: Thu Apr
7 15:18:13 2005 -0700
568 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
569 CommitDate
: Thu Apr
7 15:18:13 2005 -0700
573 commit e2552eeb08597fac52b221ecdcdda3d73b298adf066bd68a75e6d78b5c3ae0a8
574 Reflog
: HEAD@
{5} (Fra mewor k
(Committer
) <framework@example.org
>)
576 Author
: Te s t
(Author
) <test@example.net
>
577 AuthorDate
: Thu Apr
7 15:17:13 2005 -0700
578 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
579 CommitDate
: Thu Apr
7 15:17:13 2005 -0700
583 commit
196f1299c911ab944da342f5df818d2c930c84a6efecf6ab73e074abec73aa1c
584 Reflog
: HEAD@
{6} (Fra mewor k
(Committer
) <framework@example.org
>)
586 Author
: Te s t
(Author
) <test@example.net
>
587 AuthorDate
: Thu Apr
7 15:16:13 2005 -0700
588 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
589 CommitDate
: Thu Apr
7 15:16:13 2005 -0700
593 commit
7dec28d627784a76bef56727ce0da16f78c9bf93c4ee21d63c26bfe19aec525b
594 Reflog
: HEAD@
{7} (Fra mewor k
(Committer
) <framework@example.org
>)
596 Author
: Te s t
(Author
) <test@example.net
>
597 AuthorDate
: Thu Apr
7 15:15:13 2005 -0700
598 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
599 CommitDate
: Thu Apr
7 15:15:13 2005 -0700
603 commit ecf5cd744123c8f322d61b4a97d18d75f1c25440ca838a9654decff6b8697226
604 Reflog
: HEAD@
{8} (Fra mewor k
(Committer
) <framework@example.org
>)
606 Author
: Te s t
(Author
) <test@example.net
>
607 AuthorDate
: Thu Apr
7 15:14:13 2005 -0700
608 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
609 CommitDate
: Thu Apr
7 15:14:13 2005 -0700
613 commit
079309f2fa99f1dc84e7d2b40b25766e2e6ff4da86bc8f2be31487085cc9359a
614 Reflog
: HEAD@
{9} (Fra mewor k
(Committer
) <framework@example.org
>)
616 Author
: Te s t
(Author
) <test@example.net
>
617 AuthorDate
: Thu Apr
7 15:13:13 2005 -0700
618 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
619 CommitDate
: Thu Apr
7 15:13:13 2005 -0700
624 test "$test_hash_algo" != "sha256" ||
625 cat <<\EOT
>HEAD_linked.log || die
626 commit
6fda165d8aaa203d2bf9a67dcd750ac6e273489ea89e174866c1170d81cf2f73
627 Reflog
: HEAD@
{0} (Fra mewor k
(Committer
) <framework@example.org
>)
628 Reflog message
: attaching back to linked c1
629 Author
: Te s t
(Author
) <test@example.net
>
630 AuthorDate
: Thu Apr
7 15:20:13 2005 -0700
631 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
632 CommitDate
: Thu Apr
7 15:20:13 2005 -0700
636 commit e2552eeb08597fac52b221ecdcdda3d73b298adf066bd68a75e6d78b5c3ae0a8
637 Reflog
: HEAD@
{1} (Fra mewor k
(Committer
) <framework@example.org
>)
638 Reflog message
: detaching to linked c4
639 Author
: Te s t
(Author
) <test@example.net
>
640 AuthorDate
: Thu Apr
7 15:17:13 2005 -0700
641 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
642 CommitDate
: Thu Apr
7 15:17:13 2005 -0700
646 commit
6fda165d8aaa203d2bf9a67dcd750ac6e273489ea89e174866c1170d81cf2f73
647 Reflog
: HEAD@
{2} (Fra mewor k
(Committer
) <framework@example.org
>)
649 Author
: Te s t
(Author
) <test@example.net
>
650 AuthorDate
: Thu Apr
7 15:20:13 2005 -0700
651 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
652 CommitDate
: Thu Apr
7 15:20:13 2005 -0700
656 commit
1a6140d409f963b95143d6d2ca04ceb547c798938ddac9e34f4be143c3de2e0e
657 Reflog
: HEAD@
{3} (Fra mewor k
(Committer
) <framework@example.org
>)
659 Author
: Te s t
(Author
) <test@example.net
>
660 AuthorDate
: Thu Apr
7 15:19:13 2005 -0700
661 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
662 CommitDate
: Thu Apr
7 15:19:13 2005 -0700
666 commit a45e681849307b92993a9798ae71198df602a16281a29810fc1180139e426e89
667 Reflog
: HEAD@
{4} (Fra mewor k
(Committer
) <framework@example.org
>)
669 Author
: Te s t
(Author
) <test@example.net
>
670 AuthorDate
: Thu Apr
7 15:18:13 2005 -0700
671 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
672 CommitDate
: Thu Apr
7 15:18:13 2005 -0700
676 commit e2552eeb08597fac52b221ecdcdda3d73b298adf066bd68a75e6d78b5c3ae0a8
677 Reflog
: HEAD@
{5} (Fra mewor k
(Committer
) <framework@example.org
>)
679 Author
: Te s t
(Author
) <test@example.net
>
680 AuthorDate
: Thu Apr
7 15:17:13 2005 -0700
681 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
682 CommitDate
: Thu Apr
7 15:17:13 2005 -0700
686 commit
8575f83fcc048762d2e22aebed05a05bc0d7bada62665eacf83fbff2afb88a7a
687 Reflog
: HEAD@
{6} (Fra mewor k
(Committer
) <framework@example.org
>)
689 Author
: Te s t
(Author
) <test@example.net
>
690 AuthorDate
: Thu Apr
7 15:16:13 2005 -0700
691 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
692 CommitDate
: Thu Apr
7 15:16:13 2005 -0700
696 commit
821fd1740f7c0903282e1f7e16b90891732f6f1480dd997591462a4514cc1d5a
697 Reflog
: HEAD@
{7} (Fra mewor k
(Committer
) <framework@example.org
>)
699 Author
: Te s t
(Author
) <test@example.net
>
700 AuthorDate
: Thu Apr
7 15:15:13 2005 -0700
701 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
702 CommitDate
: Thu Apr
7 15:15:13 2005 -0700
706 commit e2473e861fd48f0ece81fdbd760dde169c6e00c57b426f85853b59203760214b
707 Reflog
: HEAD@
{8} (Fra mewor k
(Committer
) <framework@example.org
>)
709 Author
: Te s t
(Author
) <test@example.net
>
710 AuthorDate
: Thu Apr
7 15:14:13 2005 -0700
711 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
712 CommitDate
: Thu Apr
7 15:14:13 2005 -0700
716 commit a6345fe47a02ec4a2f0f5b749104a44dddff871fcea90b2525b0a5eb1af946e2
717 Reflog
: HEAD@
{9} (Fra mewor k
(Committer
) <framework@example.org
>)
719 Author
: Te s t
(Author
) <test@example.net
>
720 AuthorDate
: Thu Apr
7 15:13:13 2005 -0700
721 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
722 CommitDate
: Thu Apr
7 15:13:13 2005 -0700
727 test "$test_hash_algo" != "sha256" ||
728 cat <<\EOT
>master.log
729 commit e784e427bc756c7dab3c5c993ce172605b03911f4a4cee2b472f5eaf47439f1f
730 Reflog
: master@
{0} (Fra mewor k
(Committer
) <framework@example.org
>)
732 Author
: Te s t
(Author
) <test@example.net
>
733 AuthorDate
: Thu Apr
7 15:20:13 2005 -0700
734 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
735 CommitDate
: Thu Apr
7 15:20:13 2005 -0700
739 commit
201a80d1dac354e3bf8f5ffd8d6ed3bf45425d25903e51c5b5fe581ed1915b2b
740 Reflog
: master@
{1} (Fra mewor k
(Committer
) <framework@example.org
>)
742 Author
: Te s t
(Author
) <test@example.net
>
743 AuthorDate
: Thu Apr
7 15:19:13 2005 -0700
744 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
745 CommitDate
: Thu Apr
7 15:19:13 2005 -0700
749 commit
71acff480527a965010d8d59c50ed31ccff26637eb259ecd29aeb48f90dbcbd6
750 Reflog
: master@
{2} (Fra mewor k
(Committer
) <framework@example.org
>)
752 Author
: Te s t
(Author
) <test@example.net
>
753 AuthorDate
: Thu Apr
7 15:18:13 2005 -0700
754 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
755 CommitDate
: Thu Apr
7 15:18:13 2005 -0700
759 commit e2552eeb08597fac52b221ecdcdda3d73b298adf066bd68a75e6d78b5c3ae0a8
760 Reflog
: master@
{3} (Fra mewor k
(Committer
) <framework@example.org
>)
762 Author
: Te s t
(Author
) <test@example.net
>
763 AuthorDate
: Thu Apr
7 15:17:13 2005 -0700
764 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
765 CommitDate
: Thu Apr
7 15:17:13 2005 -0700
769 commit
196f1299c911ab944da342f5df818d2c930c84a6efecf6ab73e074abec73aa1c
770 Reflog
: master@
{4} (Fra mewor k
(Committer
) <framework@example.org
>)
772 Author
: Te s t
(Author
) <test@example.net
>
773 AuthorDate
: Thu Apr
7 15:16:13 2005 -0700
774 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
775 CommitDate
: Thu Apr
7 15:16:13 2005 -0700
779 commit
7dec28d627784a76bef56727ce0da16f78c9bf93c4ee21d63c26bfe19aec525b
780 Reflog
: master@
{5} (Fra mewor k
(Committer
) <framework@example.org
>)
782 Author
: Te s t
(Author
) <test@example.net
>
783 AuthorDate
: Thu Apr
7 15:15:13 2005 -0700
784 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
785 CommitDate
: Thu Apr
7 15:15:13 2005 -0700
789 commit ecf5cd744123c8f322d61b4a97d18d75f1c25440ca838a9654decff6b8697226
790 Reflog
: master@
{6} (Fra mewor k
(Committer
) <framework@example.org
>)
792 Author
: Te s t
(Author
) <test@example.net
>
793 AuthorDate
: Thu Apr
7 15:14:13 2005 -0700
794 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
795 CommitDate
: Thu Apr
7 15:14:13 2005 -0700
799 commit
079309f2fa99f1dc84e7d2b40b25766e2e6ff4da86bc8f2be31487085cc9359a
800 Reflog
: master@
{7} (Fra mewor k
(Committer
) <framework@example.org
>)
802 Author
: Te s t
(Author
) <test@example.net
>
803 AuthorDate
: Thu Apr
7 15:13:13 2005 -0700
804 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
805 CommitDate
: Thu Apr
7 15:13:13 2005 -0700
810 test "$test_hash_algo" != "sha256" ||
811 cat <<\EOT
>linked.log
812 commit
6fda165d8aaa203d2bf9a67dcd750ac6e273489ea89e174866c1170d81cf2f73
813 Reflog
: linked@
{0} (Fra mewor k
(Committer
) <framework@example.org
>)
815 Author
: Te s t
(Author
) <test@example.net
>
816 AuthorDate
: Thu Apr
7 15:20:13 2005 -0700
817 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
818 CommitDate
: Thu Apr
7 15:20:13 2005 -0700
822 commit
1a6140d409f963b95143d6d2ca04ceb547c798938ddac9e34f4be143c3de2e0e
823 Reflog
: linked@
{1} (Fra mewor k
(Committer
) <framework@example.org
>)
825 Author
: Te s t
(Author
) <test@example.net
>
826 AuthorDate
: Thu Apr
7 15:19:13 2005 -0700
827 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
828 CommitDate
: Thu Apr
7 15:19:13 2005 -0700
832 commit a45e681849307b92993a9798ae71198df602a16281a29810fc1180139e426e89
833 Reflog
: linked@
{2} (Fra mewor k
(Committer
) <framework@example.org
>)
835 Author
: Te s t
(Author
) <test@example.net
>
836 AuthorDate
: Thu Apr
7 15:18:13 2005 -0700
837 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
838 CommitDate
: Thu Apr
7 15:18:13 2005 -0700
842 commit e2552eeb08597fac52b221ecdcdda3d73b298adf066bd68a75e6d78b5c3ae0a8
843 Reflog
: linked@
{3} (Fra mewor k
(Committer
) <framework@example.org
>)
845 Author
: Te s t
(Author
) <test@example.net
>
846 AuthorDate
: Thu Apr
7 15:17:13 2005 -0700
847 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
848 CommitDate
: Thu Apr
7 15:17:13 2005 -0700
852 commit
8575f83fcc048762d2e22aebed05a05bc0d7bada62665eacf83fbff2afb88a7a
853 Reflog
: linked@
{4} (Fra mewor k
(Committer
) <framework@example.org
>)
855 Author
: Te s t
(Author
) <test@example.net
>
856 AuthorDate
: Thu Apr
7 15:16:13 2005 -0700
857 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
858 CommitDate
: Thu Apr
7 15:16:13 2005 -0700
862 commit
821fd1740f7c0903282e1f7e16b90891732f6f1480dd997591462a4514cc1d5a
863 Reflog
: linked@
{5} (Fra mewor k
(Committer
) <framework@example.org
>)
865 Author
: Te s t
(Author
) <test@example.net
>
866 AuthorDate
: Thu Apr
7 15:15:13 2005 -0700
867 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
868 CommitDate
: Thu Apr
7 15:15:13 2005 -0700
872 commit e2473e861fd48f0ece81fdbd760dde169c6e00c57b426f85853b59203760214b
873 Reflog
: linked@
{6} (Fra mewor k
(Committer
) <framework@example.org
>)
875 Author
: Te s t
(Author
) <test@example.net
>
876 AuthorDate
: Thu Apr
7 15:14:13 2005 -0700
877 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
878 CommitDate
: Thu Apr
7 15:14:13 2005 -0700
882 commit a6345fe47a02ec4a2f0f5b749104a44dddff871fcea90b2525b0a5eb1af946e2
883 Reflog
: linked@
{7} (Fra mewor k
(Committer
) <framework@example.org
>)
885 Author
: Te s t
(Author
) <test@example.net
>
886 AuthorDate
: Thu Apr
7 15:13:13 2005 -0700
887 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
888 CommitDate
: Thu Apr
7 15:13:13 2005 -0700
893 test_expect_success LASTOK
'verify setup' '
894 test -f "main/.git/objects/pack/$objpack.idx" &&
895 test -f "main/.git/objects/pack/$objpack.pack" &&
897 mv -f ".git/objects/pack/$objpack.idx" ".git/objects/pack/$objpack.no" &&
898 test_must_fail git fsck --full &&
899 mv -f ".git/objects/pack/$objpack.no" ".git/objects/pack/$objpack.idx" &&
901 git log -g --pretty=fuller HEAD >actual &&
902 test_cmp actual ../HEAD_main.log &&
903 git log -g --pretty=fuller master >actual &&
904 test_cmp actual ../master.log &&
905 if test_have_prereq GIT_2_5; then
907 git log -g --pretty=fuller HEAD >actual &&
908 test_cmp actual ../HEAD_linked.log &&
909 git log -g --pretty=fuller linked >actual &&
910 test_cmp actual ../linked.log
912 test_when_finished test_set_prereq SETUP
915 test "$test_hash_algo" != "sha1" ||
916 cat <<\EOT
>tgHEAD_main.log || die
918 dd1016e3
15:20:13 (commit
) HEAD@
{0}: attaching back to c7
919 40403e00
15:20:13 (commit
) HEAD@
{1}: detaching to c4
920 dd1016e3
15:20:13 (commit
) HEAD@
{2}: file 7
921 84b1e4e6
15:19:13 (commit
) HEAD@
{3}: file 6
922 8238c7e7
15:18:13 (commit
) HEAD@
{4}: file 5
923 40403e00
15:17:13 (commit
) HEAD@
{5}: file 4
924 feeb764a
15:16:13 (commit
) HEAD@
{6}: file 3
925 c0ed6e70
15:15:13 (commit
) HEAD@
{7}: file 2
926 c18fcef2
15:14:13 (commit
) HEAD@
{8}: file 1
927 b63866e5
15:13:13 (commit
) HEAD@
{9}: empty
930 test "$test_hash_algo" != "sha256" ||
931 cat <<\EOT
>tgHEAD_main.log || die
933 e784e427
15:20:13 (commit
) HEAD@
{0}: attaching back to c7
934 e2552eeb
15:20:13 (commit
) HEAD@
{1}: detaching to c4
935 e784e427
15:20:13 (commit
) HEAD@
{2}: file 7
936 201a80d1
15:19:13 (commit
) HEAD@
{3}: file 6
937 71acff48
15:18:13 (commit
) HEAD@
{4}: file 5
938 e2552eeb
15:17:13 (commit
) HEAD@
{5}: file 4
939 196f1299
15:16:13 (commit
) HEAD@
{6}: file 3
940 7dec28d6
15:15:13 (commit
) HEAD@
{7}: file 2
941 ecf5cd74
15:14:13 (commit
) HEAD@
{8}: file 1
942 079309f2
15:13:13 (commit
) HEAD@
{9}: empty
945 test_expect_success SETUP
'tag -g HEAD' '
947 tg tag -g HEAD >actual &&
948 test_cmp actual ../tgHEAD_main.log
951 test_expect_success SETUP
'tag -g --no-type HEAD' '
953 sed "s/(commit) //" <../tgHEAD_main.log >expected &&
954 tg tag -g --no-type HEAD >actual &&
955 test_cmp actual expected
958 test "$test_hash_algo" != "sha1" ||
959 cat <<\EOT
>tgmaster.log || die
961 dd1016e3
15:20:13 (commit
) master@
{0}: file 7
962 84b1e4e6
15:19:13 (commit
) master@
{1}: file 6
963 8238c7e7
15:18:13 (commit
) master@
{2}: file 5
964 40403e00
15:17:13 (commit
) master@
{3}: file 4
965 feeb764a
15:16:13 (commit
) master@
{4}: file 3
966 c0ed6e70
15:15:13 (commit
) master@
{5}: file 2
967 c18fcef2
15:14:13 (commit
) master@
{6}: file 1
968 b63866e5
15:13:13 (commit
) master@
{7}: empty
971 test "$test_hash_algo" != "sha256" ||
972 cat <<\EOT
>tgmaster.log || die
974 e784e427
15:20:13 (commit
) master@
{0}: file 7
975 201a80d1
15:19:13 (commit
) master@
{1}: file 6
976 71acff48
15:18:13 (commit
) master@
{2}: file 5
977 e2552eeb
15:17:13 (commit
) master@
{3}: file 4
978 196f1299
15:16:13 (commit
) master@
{4}: file 3
979 7dec28d6
15:15:13 (commit
) master@
{5}: file 2
980 ecf5cd74
15:14:13 (commit
) master@
{6}: file 1
981 079309f2
15:13:13 (commit
) master@
{7}: empty
984 test_expect_success SETUP
'tag -g master' '
986 tg tag -g master >actual &&
987 test_cmp actual ../tgmaster.log
990 test_expect_success SETUP
'tag -g --no-type master' '
992 sed "s/(commit) //" <../tgmaster.log >expected &&
993 tg tag -g --no-type master >actual &&
994 test_cmp actual expected
997 test_expect_success SETUP
'rev-parse --verify master@{0..7}' '
999 test_must_fail git rev-parse --verify master@{8} -- &&
1000 case "$test_hash_algo" in
1002 test_cmp_rev b63866e5 master@{7} &&
1003 test_cmp_rev c18fcef2 master@{6} &&
1004 test_cmp_rev c0ed6e70 master@{5} &&
1005 test_cmp_rev feeb764a master@{4} &&
1006 test_cmp_rev 40403e00 master@{3} &&
1007 test_cmp_rev 8238c7e7 master@{2} &&
1008 test_cmp_rev 84b1e4e6 master@{1} &&
1009 test_cmp_rev dd1016e3 master@{0}
1012 test_cmp_rev 079309f2 master@{7} &&
1013 test_cmp_rev ecf5cd74 master@{6} &&
1014 test_cmp_rev 7dec28d6 master@{5} &&
1015 test_cmp_rev 196f1299 master@{4} &&
1016 test_cmp_rev e2552eeb master@{3} &&
1017 test_cmp_rev 71acff48 master@{2} &&
1018 test_cmp_rev 201a80d1 master@{1} &&
1019 test_cmp_rev e784e427 master@{0}
1020 ;;*) die unknown hash "$test_hash_algo"
1022 test_cmp_rev master master@{0}
1025 test "$test_hash_algo" != "sha1" ||
1026 cat <<\EOT
>tgHEAD_linked.log || die
1028 04eea982
15:20:13 (commit
) HEAD@
{0}: attaching back to linked c1
1029 40403e00
15:20:13 (commit
) HEAD@
{1}: detaching to linked c4
1030 04eea982
15:20:13 (commit
) HEAD@
{2}: file 1
1031 4d776c64
15:19:13 (commit
) HEAD@
{3}: file 2
1032 602d59a7
15:18:13 (commit
) HEAD@
{4}: file 3
1033 40403e00
15:17:13 (commit
) HEAD@
{5}: file 4
1034 0a45d475
15:16:13 (commit
) HEAD@
{6}: file 5
1035 e053b7d1
15:15:13 (commit
) HEAD@
{7}: file 6
1036 2849f113
15:14:13 (commit
) HEAD@
{8}: file 7
1037 fce870c7
15:13:13 (commit
) HEAD@
{9}: empty linked
1040 test "$test_hash_algo" != "sha256" ||
1041 cat <<\EOT
>tgHEAD_linked.log || die
1043 6fda165d
15:20:13 (commit
) HEAD@
{0}: attaching back to linked c1
1044 e2552eeb
15:20:13 (commit
) HEAD@
{1}: detaching to linked c4
1045 6fda165d
15:20:13 (commit
) HEAD@
{2}: file 1
1046 1a6140d4
15:19:13 (commit
) HEAD@
{3}: file 2
1047 a45e6818
15:18:13 (commit
) HEAD@
{4}: file 3
1048 e2552eeb
15:17:13 (commit
) HEAD@
{5}: file 4
1049 8575f83f
15:16:13 (commit
) HEAD@
{6}: file 5
1050 821fd174
15:15:13 (commit
) HEAD@
{7}: file 6
1051 e2473e86
15:14:13 (commit
) HEAD@
{8}: file 7
1052 a6345fe4
15:13:13 (commit
) HEAD@
{9}: empty linked
1055 test_expect_success
'SETUP GIT_2_5' 'tag -g HEAD [linked]' '
1057 tg tag -g HEAD >actual &&
1058 test_cmp actual ../tgHEAD_linked.log
1061 test_expect_success
'SETUP GIT_2_5' 'tag -g --no-type HEAD [linked]' '
1063 sed "s/(commit) //" <../tgHEAD_linked.log >expected &&
1064 tg tag -g --no-type HEAD >actual &&
1065 test_cmp actual expected
1068 test "$test_hash_algo" != "sha1" ||
1069 cat <<\EOT
>tglinked.log || die
1071 04eea982
15:20:13 (commit
) linked@
{0}: file 1
1072 4d776c64
15:19:13 (commit
) linked@
{1}: file 2
1073 602d59a7
15:18:13 (commit
) linked@
{2}: file 3
1074 40403e00
15:17:13 (commit
) linked@
{3}: file 4
1075 0a45d475
15:16:13 (commit
) linked@
{4}: file 5
1076 e053b7d1
15:15:13 (commit
) linked@
{5}: file 6
1077 2849f113
15:14:13 (commit
) linked@
{6}: file 7
1078 fce870c7
15:13:13 (commit
) linked@
{7}: empty linked
1081 test "$test_hash_algo" != "sha256" ||
1082 cat <<\EOT
>tglinked.log || die
1084 6fda165d
15:20:13 (commit
) linked@
{0}: file 1
1085 1a6140d4
15:19:13 (commit
) linked@
{1}: file 2
1086 a45e6818
15:18:13 (commit
) linked@
{2}: file 3
1087 e2552eeb
15:17:13 (commit
) linked@
{3}: file 4
1088 8575f83f
15:16:13 (commit
) linked@
{4}: file 5
1089 821fd174
15:15:13 (commit
) linked@
{5}: file 6
1090 e2473e86
15:14:13 (commit
) linked@
{6}: file 7
1091 a6345fe4
15:13:13 (commit
) linked@
{7}: empty linked
1094 test_expect_success
'SETUP GIT_2_5' 'tag -g linked' '
1096 tg tag -g linked >actual &&
1097 test_cmp actual ../tglinked.log &&
1099 tg tag -g linked >actual &&
1100 test_cmp actual ../tglinked.log
1103 test_expect_success
'SETUP GIT_2_5' 'tag --no-type -g linked' '
1105 sed "s/(commit) //" <../tglinked.log >expected &&
1106 tg tag -g --no-type linked >actual &&
1107 test_cmp actual expected &&
1109 tg tag -g --no-type linked >actual &&
1110 test_cmp actual ../linked/expected
1113 test_expect_success
'SETUP GIT_2_5' 'rev-parse --verify linked@{0..7}' '
1115 test_must_fail git rev-parse --verify linked@{8} -- &&
1116 case "$test_hash_algo" in
1118 test_cmp_rev fce870c7 linked@{7} &&
1119 test_cmp_rev 2849f113 linked@{6} &&
1120 test_cmp_rev e053b7d1 linked@{5} &&
1121 test_cmp_rev 0a45d475 linked@{4} &&
1122 test_cmp_rev 40403e00 linked@{3} &&
1123 test_cmp_rev 602d59a7 linked@{2} &&
1124 test_cmp_rev 4d776c64 linked@{1} &&
1125 test_cmp_rev 04eea982 linked@{0}
1128 test_cmp_rev a6345fe4 linked@{7} &&
1129 test_cmp_rev e2473e86 linked@{6} &&
1130 test_cmp_rev 821fd174 linked@{5} &&
1131 test_cmp_rev 8575f83f linked@{4} &&
1132 test_cmp_rev e2552eeb linked@{3} &&
1133 test_cmp_rev a45e6818 linked@{2} &&
1134 test_cmp_rev 1a6140d4 linked@{1} &&
1135 test_cmp_rev 6fda165d linked@{0}
1136 ;;*) die unknown hash "$test_hash_algo"
1138 test_cmp_rev linked linked@{0}
1141 test "$test_hash_algo" != "sha1" ||
1142 cat <<\EOT
>tgHEAD_main_1.log || die
1144 dd1016e3
15:20:13 (commit
) HEAD@
{0}: attaching back to c7
1145 dd1016e3
15:20:13 (commit
) HEAD@
{1}: file 7
1146 84b1e4e6
15:19:13 (commit
) HEAD@
{2}: file 6
1147 8238c7e7
15:18:13 (commit
) HEAD@
{3}: file 5
1148 40403e00
15:17:13 (commit
) HEAD@
{4}: file 4
1149 feeb764a
15:16:13 (commit
) HEAD@
{5}: file 3
1150 c0ed6e70
15:15:13 (commit
) HEAD@
{6}: file 2
1151 c18fcef2
15:14:13 (commit
) HEAD@
{7}: file 1
1152 b63866e5
15:13:13 (commit
) HEAD@
{8}: empty
1155 test "$test_hash_algo" != "sha256" ||
1156 cat <<\EOT
>tgHEAD_main_1.log || die
1158 e784e427
15:20:13 (commit
) HEAD@
{0}: attaching back to c7
1159 e784e427
15:20:13 (commit
) HEAD@
{1}: file 7
1160 201a80d1
15:19:13 (commit
) HEAD@
{2}: file 6
1161 71acff48
15:18:13 (commit
) HEAD@
{3}: file 5
1162 e2552eeb
15:17:13 (commit
) HEAD@
{4}: file 4
1163 196f1299
15:16:13 (commit
) HEAD@
{5}: file 3
1164 7dec28d6
15:15:13 (commit
) HEAD@
{6}: file 2
1165 ecf5cd74
15:14:13 (commit
) HEAD@
{7}: file 1
1166 079309f2
15:13:13 (commit
) HEAD@
{8}: empty
1169 test_expect_success SETUP
'tag --drop HEAD@{1}' '
1171 tg tag --drop HEAD@{1} &&
1172 tg tag -g HEAD >actual &&
1173 test_cmp actual ../tgHEAD_main_1.log
1176 test_expect_success SETUP
'tag --drop HEAD@{9} fails' '
1178 test_must_fail tg tag --drop HEAD@{9}
1181 test_expect_success SETUP
'tag --drop HEAD@{8}' '
1183 sed <../tgHEAD_main_1.log -n "1,9p" >expected &&
1184 tg tag --drop HEAD@{8} &&
1185 tg tag -g HEAD >actual &&
1186 test_cmp actual expected
1189 test "$test_hash_algo" != "sha1" ||
1190 cat <<\EOT
>tgmaster_3.log || die
1192 dd1016e3
15:20:13 (commit
) master@
{0}: file 7
1193 84b1e4e6
15:19:13 (commit
) master@
{1}: file 6
1194 8238c7e7
15:18:13 (commit
) master@
{2}: file 5
1195 feeb764a
15:16:13 (commit
) master@
{3}: file 3
1196 c0ed6e70
15:15:13 (commit
) master@
{4}: file 2
1197 c18fcef2
15:14:13 (commit
) master@
{5}: file 1
1198 b63866e5
15:13:13 (commit
) master@
{6}: empty
1201 test "$test_hash_algo" != "sha256" ||
1202 cat <<\EOT
>tgmaster_3.log || die
1204 e784e427
15:20:13 (commit
) master@
{0}: file 7
1205 201a80d1
15:19:13 (commit
) master@
{1}: file 6
1206 71acff48
15:18:13 (commit
) master@
{2}: file 5
1207 196f1299
15:16:13 (commit
) master@
{3}: file 3
1208 7dec28d6
15:15:13 (commit
) master@
{4}: file 2
1209 ecf5cd74
15:14:13 (commit
) master@
{5}: file 1
1210 079309f2
15:13:13 (commit
) master@
{6}: empty
1213 test_expect_success SETUP
'tag --drop master@{3}' '
1215 tg tag --drop master@{3} &&
1216 tg tag -g master >actual &&
1217 test_cmp actual ../tgmaster_3.log
1220 test_expect_success SETUP
'tag --drop master@{7} fails' '
1222 test_must_fail tg tag --drop master@{7}
1225 test_expect_success SETUP
'tag --drop master@{6}' '
1227 sed <../tgmaster_3.log -n "1,7p" >expected &&
1228 tg tag --drop master@{6} &&
1229 tg tag -g master >actual &&
1230 test_cmp actual expected
1233 test "$test_hash_algo" != "sha1" ||
1234 cat <<\EOT
>tgHEAD_linked_1.log || die
1236 04eea982
15:20:13 (commit
) HEAD@
{0}: attaching back to linked c1
1237 04eea982
15:20:13 (commit
) HEAD@
{1}: file 1
1238 4d776c64
15:19:13 (commit
) HEAD@
{2}: file 2
1239 602d59a7
15:18:13 (commit
) HEAD@
{3}: file 3
1240 40403e00
15:17:13 (commit
) HEAD@
{4}: file 4
1241 0a45d475
15:16:13 (commit
) HEAD@
{5}: file 5
1242 e053b7d1
15:15:13 (commit
) HEAD@
{6}: file 6
1243 2849f113
15:14:13 (commit
) HEAD@
{7}: file 7
1244 fce870c7
15:13:13 (commit
) HEAD@
{8}: empty linked
1247 test "$test_hash_algo" != "sha256" ||
1248 cat <<\EOT
>tgHEAD_linked_1.log || die
1250 6fda165d
15:20:13 (commit
) HEAD@
{0}: attaching back to linked c1
1251 6fda165d
15:20:13 (commit
) HEAD@
{1}: file 1
1252 1a6140d4
15:19:13 (commit
) HEAD@
{2}: file 2
1253 a45e6818
15:18:13 (commit
) HEAD@
{3}: file 3
1254 e2552eeb
15:17:13 (commit
) HEAD@
{4}: file 4
1255 8575f83f
15:16:13 (commit
) HEAD@
{5}: file 5
1256 821fd174
15:15:13 (commit
) HEAD@
{6}: file 6
1257 e2473e86
15:14:13 (commit
) HEAD@
{7}: file 7
1258 a6345fe4
15:13:13 (commit
) HEAD@
{8}: empty linked
1261 test_expect_success
'SETUP GIT_2_5' 'tag --drop HEAD@{1} [linked]' '
1263 tg tag --drop HEAD@{1} &&
1264 tg tag -g HEAD >actual &&
1265 test_cmp actual ../tgHEAD_linked_1.log
1268 test_expect_success
'SETUP GIT_2_5' 'tag --drop HEAD@{9} [linked] fails' '
1270 test_must_fail tg tag --drop HEAD@{9}
1273 test_expect_success
'SETUP GIT_2_5' 'tag --drop HEAD@{8} [linked]' '
1275 sed <../tgHEAD_linked_1.log -n "1,9p" >expected &&
1276 tg tag --drop HEAD@{8} &&
1277 tg tag -g HEAD >actual &&
1278 test_cmp actual expected
1281 test "$test_hash_algo" != "sha1" ||
1282 cat <<\EOT
>tglinked_2.log || die
1284 04eea982
15:20:13 (commit
) linked@
{0}: file 1
1285 4d776c64
15:19:13 (commit
) linked@
{1}: file 2
1286 40403e00
15:17:13 (commit
) linked@
{2}: file 4
1287 0a45d475
15:16:13 (commit
) linked@
{3}: file 5
1288 e053b7d1
15:15:13 (commit
) linked@
{4}: file 6
1289 2849f113
15:14:13 (commit
) linked@
{5}: file 7
1290 fce870c7
15:13:13 (commit
) linked@
{6}: empty linked
1293 test "$test_hash_algo" != "sha256" ||
1294 cat <<\EOT
>tglinked_2.log || die
1296 6fda165d
15:20:13 (commit
) linked@
{0}: file 1
1297 1a6140d4
15:19:13 (commit
) linked@
{1}: file 2
1298 e2552eeb
15:17:13 (commit
) linked@
{2}: file 4
1299 8575f83f
15:16:13 (commit
) linked@
{3}: file 5
1300 821fd174
15:15:13 (commit
) linked@
{4}: file 6
1301 e2473e86
15:14:13 (commit
) linked@
{5}: file 7
1302 a6345fe4
15:13:13 (commit
) linked@
{6}: empty linked
1305 test_expect_success
'SETUP GIT_2_5' 'tag --drop linked@{2}' '
1307 tg tag --drop linked@{2} &&
1308 tg tag -g linked >actual &&
1309 test_cmp actual ../tglinked_2.log
1312 test_expect_success
'SETUP GIT_2_5' 'tag --drop linked@{7} fails' '
1314 test_must_fail tg tag --drop linked@{7}
1317 test_expect_success
'SETUP GIT_2_5' 'tag --drop linked@{6}' '
1319 sed <../tglinked_2.log -n "1,7p" >expected &&
1320 tg tag --drop linked@{6} &&
1321 tg tag -g linked >actual &&
1322 test_cmp actual expected
1325 test_expect_success SETUP
'tag --drop master@{0}' '
1327 m0="$(git rev-parse --verify master@{0})" && test -n "$m0" &&
1328 m1="$(git rev-parse --verify master@{1})" && test -n "$m1" &&
1329 m="$(git rev-parse --verify master)" && test -n "$m" &&
1330 test "$m" = "$m0" &&
1331 test "$m0" != "$m1" &&
1332 tg tag --drop master@{0} &&
1333 m0new="$(git rev-parse --verify master@{0})" && test -n "$m0new" &&
1334 mnew="$(git rev-parse --verify master)" && test -n "$mnew" &&
1335 test "$mnew" = "$m0new" &&
1336 test "$m0new" = "$m1"
1339 test_expect_success
'SETUP GIT_2_5' 'tag --drop linked@{0}' '
1341 l0="$(git rev-parse --verify linked@{0})" && test -n "$l0" &&
1342 l1="$(git rev-parse --verify linked@{1})" && test -n "$l1" &&
1343 l="$(git rev-parse --verify linked)" && test -n "$l" &&
1344 test "$l" = "$l0" &&
1345 test "$l0" != "$l1" &&
1346 tg tag --drop linked@{0} &&
1347 l0new="$(git rev-parse --verify linked@{0})" && test -n "$l0new" &&
1348 lnew="$(git rev-parse --verify linked)" && test -n "$lnew" &&
1349 test "$lnew" = "$l0new" &&
1350 test "$l0new" = "$l1"
1353 test_expect_success SETUP
'rev-parse --verify master@{0..4}' '
1355 test_must_fail git rev-parse --verify master@{5} -- &&
1356 case "$test_hash_algo" in
1358 test_cmp_rev c18fcef2 master@{4} &&
1359 test_cmp_rev c0ed6e70 master@{3} &&
1360 test_cmp_rev feeb764a master@{2} &&
1361 test_cmp_rev 8238c7e7 master@{1} &&
1362 test_cmp_rev 84b1e4e6 master@{0}
1365 test_cmp_rev ecf5cd74 master@{4} &&
1366 test_cmp_rev 7dec28d6 master@{3} &&
1367 test_cmp_rev 196f1299 master@{2} &&
1368 test_cmp_rev 71acff48 master@{1} &&
1369 test_cmp_rev 201a80d1 master@{0}
1370 ;;*) die unknown hash "$test_hash_algo"
1372 test_cmp_rev master master@{0}
1375 test_expect_success
'SETUP GIT_2_5' 'rev-parse --verify linked@{0..4}' '
1377 test_must_fail git rev-parse --verify linked@{5} -- &&
1378 case "$test_hash_algo" in
1380 test_cmp_rev 2849f113 linked@{4} &&
1381 test_cmp_rev e053b7d1 linked@{3} &&
1382 test_cmp_rev 0a45d475 linked@{2} &&
1383 test_cmp_rev 40403e00 linked@{1} &&
1384 test_cmp_rev 4d776c64 linked@{0}
1387 test_cmp_rev e2473e86 linked@{4} &&
1388 test_cmp_rev 821fd174 linked@{3} &&
1389 test_cmp_rev 8575f83f linked@{2} &&
1390 test_cmp_rev e2552eeb linked@{1} &&
1391 test_cmp_rev 1a6140d4 linked@{0}
1392 ;;*) die unknown hash "$test_hash_algo"
1394 test_cmp_rev linked linked@{0}
1397 test_expect_success SETUP
'tag --drop symref HEAD@{0}' '
1399 h0="$(git rev-parse --verify HEAD@{0})" && test -n "$h0" &&
1400 h1="$(git rev-parse --verify HEAD@{1})" && test -n "$h1" &&
1401 h="$(git rev-parse --verify HEAD)" && test -n "$h" &&
1402 if test -n "$git_231_plus"; then
1403 test "$h" != "$h0" &&
1406 test "$h" = "$h0" &&
1409 tg tag --drop HEAD@{0} &&
1410 h0new="$(git rev-parse --verify HEAD@{0})" && test -n "$h0new" &&
1411 hnew="$(git rev-parse --verify HEAD)" && test -n "$hnew" &&
1412 if test -n "$git_231_plus"; then
1413 test "$hnew" != "$h0new"
1415 test "$hnew" = "$h0new"
1417 test "$h0new" = "$h0" &&
1421 test_expect_success
'SETUP GIT_2_5' 'tag --drop symref HEAD@{0} [linked]' '
1423 h0="$(git rev-parse --verify HEAD@{0})" && test -n "$h0" &&
1424 h1="$(git rev-parse --verify HEAD@{1})" && test -n "$h1" &&
1425 h="$(git rev-parse --verify HEAD)" && test -n "$h" &&
1426 if test -n "$git_231_plus"; then
1427 test "$h" != "$h0" &&
1430 test "$h" = "$h0" &&
1433 tg tag --drop HEAD@{0} &&
1434 h0new="$(git rev-parse --verify HEAD@{0})" && test -n "$h0new" &&
1435 hnew="$(git rev-parse --verify HEAD)" && test -n "$hnew" &&
1436 if test -n "$git_231_plus"; then
1437 test "$hnew" != "$h0new"
1439 test "$hnew" = "$h0new"
1441 test "$h0new" = "$h0" &&
1445 test_expect_success SETUP
'tag --drop detached HEAD@{0}' '
1447 git update-ref -m detach --no-deref HEAD HEAD HEAD &&
1448 h0="$(git rev-parse --verify HEAD@{0})" && test -n "$h0" &&
1449 h1="$(git rev-parse --verify HEAD@{1})" && test -n "$h1" &&
1450 h="$(git rev-parse --verify HEAD)" && test -n "$h" &&
1451 test "$h" = "$h0" &&
1452 if test -n "$git_231_plus"; then
1457 tg tag --drop HEAD@{0} &&
1458 h0new="$(git rev-parse --verify HEAD@{0})" && test -n "$h0new" &&
1459 hnew="$(git rev-parse --verify HEAD)" && test -n "$hnew" &&
1460 if test -n "$git_231_plus"; then
1461 test "$h0new" != "$h1"
1463 test "$h0new" = "$h1"
1465 test "$hnew" = "$h0new"
1468 test_expect_success
'SETUP GIT_2_5' 'tag --drop detached HEAD@{0} [linked]' '
1470 git update-ref -m detach --no-deref HEAD HEAD HEAD &&
1471 h0="$(git rev-parse --verify HEAD@{0})" && test -n "$h0" &&
1472 h1="$(git rev-parse --verify HEAD@{1})" && test -n "$h1" &&
1473 h="$(git rev-parse --verify HEAD)" && test -n "$h" &&
1474 test "$h" = "$h0" &&
1475 if test -n "$git_231_plus"; then
1480 tg tag --drop HEAD@{0} &&
1481 h0new="$(git rev-parse --verify HEAD@{0})" && test -n "$h0new" &&
1482 hnew="$(git rev-parse --verify HEAD)" && test -n "$hnew" &&
1483 if test -n "$git_231_plus"; then
1484 test "$h0new" != "$h1"
1486 test "$h0new" = "$h1"
1488 test "$hnew" = "$h0new"
1491 test_expect_success SETUP
'staleify two log entries' '
1493 git rev-list --no-walk --objects master@{1} >/dev/null 2>&1 &&
1494 git rev-list --no-walk --objects master@{3} >/dev/null 2>&1 &&
1495 rm -f .git/objects/pack/*.idx &&
1496 test_must_fail git rev-list --no-walk --objects master@{1} >/dev/null 2>&1 &&
1497 test_must_fail git rev-list --no-walk --objects master@{3} >/dev/null 2>&1
1500 test "$test_hash_algo" != "sha1" ||
1501 cat <<\EOT
>tgmaster_fix1.log || die
1503 feeb764a
15:16:13 (commit
) master@
{0}: file 3
1504 c0ed6e70
15:15:13 (commit
) master@
{1}: file 2
1505 c18fcef2
15:14:13 (commit
) master@
{2}: file 1
1508 test "$test_hash_algo" != "sha256" ||
1509 cat <<\EOT
>tgmaster_fix1.log || die
1511 196f1299
15:16:13 (commit
) master@
{0}: file 3
1512 7dec28d6
15:15:13 (commit
) master@
{1}: file 2
1513 ecf5cd74
15:14:13 (commit
) master@
{2}: file 1
1516 test_expect_success SETUP
'tag --drop master@{0} --stale-fix 1' '
1518 tg tag --drop master@{0} &&
1519 tg tag -g master >actual &&
1520 test_cmp actual ../tgmaster_fix1.log
1523 test "$test_hash_algo" != "sha1" ||
1524 cat <<\EOT
>tgmaster_fix2.log || die
1526 c18fcef2
15:14:13 (commit
) master@
{0}: file 1
1529 test "$test_hash_algo" != "sha256" ||
1530 cat <<\EOT
>tgmaster_fix2.log || die
1532 ecf5cd74
15:14:13 (commit
) master@
{0}: file 1
1535 test_expect_success SETUP
'tag --drop master@{0} --stale-fix 2' '
1537 tg tag --drop master@{0} &&
1538 tg tag -g master >actual &&
1539 test_cmp actual ../tgmaster_fix2.log
1542 test_expect_success SETUP
'tag --drop master@{0} final entry' '
1544 tg tag --drop master@{0} &&
1545 test_must_fail tg tag -g master &&
1546 test_must_fail tg tag --drop master@{0} &&
1547 git rev-parse --verify master -- >/dev/null
1550 test "$test_hash_algo" != "sha1" ||
1551 cat <<\EOT
>tglinked_0.log || die
1553 40403e00
15:17:13 (commit
) linked@
{0}: file 4
1554 0a45d475
15:16:13 (commit
) linked@
{1}: file 5
1555 e053b7d1
15:15:13 (commit
) linked@
{2}: file 6
1556 2849f113
15:14:13 (commit
) linked@
{3}: file 7
1559 test "$test_hash_algo" != "sha256" ||
1560 cat <<\EOT
>tglinked_0.log || die
1562 e2552eeb
15:17:13 (commit
) linked@
{0}: file 4
1563 8575f83f
15:16:13 (commit
) linked@
{1}: file 5
1564 821fd174
15:15:13 (commit
) linked@
{2}: file 6
1565 e2473e86
15:14:13 (commit
) linked@
{3}: file 7
1568 test_expect_success
'SETUP GIT_2_5' 'tag --drop linked@{0} broken' '
1570 tg tag --drop linked@{0} &&
1571 tg tag -g linked >actual &&
1572 test_cmp actual ../tglinked_0.log
1575 test "$test_hash_algo" != "sha1" ||
1576 cat <<\EOT
>tglinked_fix1.log || die
1578 e053b7d1
15:15:13 (commit
) linked@
{0}: file 6
1579 2849f113
15:14:13 (commit
) linked@
{1}: file 7
1582 test "$test_hash_algo" != "sha256" ||
1583 cat <<\EOT
>tglinked_fix1.log || die
1585 821fd174
15:15:13 (commit
) linked@
{0}: file 6
1586 e2473e86
15:14:13 (commit
) linked@
{1}: file 7
1589 test_expect_success
'SETUP GIT_2_5' 'tag --drop linked@{0} --stale-fix 1' '
1591 tg tag --drop linked@{0} &&
1592 tg tag -g linked >actual &&
1593 test_cmp actual ../tglinked_fix1.log
1596 test_expect_success
'SETUP GIT_2_5' 'tag --drop linked@{0} final entries' '
1598 tg tag --drop linked@{0} &&
1599 tg tag --drop linked@{0} &&
1600 test_must_fail tg tag -g linked &&
1601 test_must_fail tg tag --drop linked@{0} &&
1602 git rev-parse --verify linked -- >/dev/null
1605 test "$test_hash_algo" != "sha1" ||
1606 cat <<\EOT
>tgHEAD_main_pre2 || die
1608 dd1016e3
15:20:13 (commit
) HEAD@
{0}: file 7
1609 8238c7e7
15:18:13 (commit
) HEAD@
{1}: file 5
1610 c0ed6e70
15:15:13 (commit
) HEAD@
{2}: file 2
1611 c18fcef2
15:14:13 (commit
) HEAD@
{3}: file 1
1614 test "$test_hash_algo" != "sha1" ||
1615 cat <<\EOT
>tgHEAD_main_double || die
1617 c18fcef2
15:14:13 (commit
) HEAD@
{0}: file 1
1620 test "$test_hash_algo" != "sha256" ||
1621 cat <<\EOT
>tgHEAD_main_pre2 || die
1623 e784e427
15:20:13 (commit
) HEAD@
{0}: file 7
1624 71acff48
15:18:13 (commit
) HEAD@
{1}: file 5
1625 7dec28d6
15:15:13 (commit
) HEAD@
{2}: file 2
1626 ecf5cd74
15:14:13 (commit
) HEAD@
{3}: file 1
1629 test "$test_hash_algo" != "sha256" ||
1630 cat <<\EOT
>tgHEAD_main_double || die
1632 ecf5cd74
15:14:13 (commit
) HEAD@
{0}: file 1
1635 test_expect_success SETUP
'tag --drop detached HEAD@{0} double stale' '
1637 tg tag --drop HEAD@{4} &&
1638 tg tag --drop HEAD@{3} &&
1639 tg tag --drop HEAD@{1} &&
1640 tg tag -g HEAD >actual &&
1641 test_cmp actual ../tgHEAD_main_pre2 &&
1642 tg tag --drop HEAD@{0} &&
1643 tg tag -g HEAD >actual &&
1644 test_cmp actual ../tgHEAD_main_double &&
1645 test_must_fail git rev-parse --verify --quiet HEAD@{1} -- >/dev/null &&
1646 git rev-parse --verify HEAD@{0} -- >/dev/null &&
1647 git rev-parse --verify HEAD -- >/dev/null
1650 test "$test_hash_algo" != "sha1" ||
1651 cat <<\EOT
>tgHEAD_linked_only || die
1653 04eea982
15:20:13 (commit
) HEAD@
{0}: file 1
1654 4d776c64
15:19:13 (commit
) HEAD@
{1}: file 2
1655 0a45d475
15:16:13 (commit
) HEAD@
{2}: file 5
1658 test "$test_hash_algo" != "sha256" ||
1659 cat <<\EOT
>tgHEAD_linked_only || die
1661 6fda165d
15:20:13 (commit
) HEAD@
{0}: file 1
1662 1a6140d4
15:19:13 (commit
) HEAD@
{1}: file 2
1663 8575f83f
15:16:13 (commit
) HEAD@
{2}: file 5
1666 test_expect_success
'SETUP GIT_2_5' 'tag --drop detached HEAD@{0} [linked] all stale' '
1667 result=test_must_fail &&
1668 { test -z "$git_231_plus" || result=; } &&
1670 tg tag --drop HEAD@{6} &&
1671 tg tag --drop HEAD@{5} &&
1672 tg tag --drop HEAD@{3} &&
1673 tg tag --drop HEAD@{2} &&
1674 tg tag -g HEAD >actual &&
1675 test_cmp actual ../tgHEAD_linked_only &&
1676 tg tag --drop HEAD@{0} &&
1677 test_must_fail git rev-parse --verify --quiet HEAD@{1} -- >/dev/null &&
1678 eval $result git rev-parse --verify --quiet HEAD@{0} -- >/dev/null &&
1679 git rev-parse --verify HEAD -- >/dev/null
1682 test "$test_hash_algo" != "sha1" ||
1683 cat <<\EOT
>tgHEAD_main_new || die
1685 c18fcef2
15:14:13 (commit
) HEAD@
{0}: allons master
1686 b63866e5
15:13:13 (commit
) HEAD@
{1}: to empty main
1687 c18fcef2
15:14:13 (commit
) HEAD@
{2}: file 1
1690 test "$test_hash_algo" != "sha256" ||
1691 cat <<\EOT
>tgHEAD_main_new || die
1693 ecf5cd74
15:14:13 (commit
) HEAD@
{0}: allons master
1694 079309f2
15:13:13 (commit
) HEAD@
{1}: to empty main
1695 ecf5cd74
15:14:13 (commit
) HEAD@
{2}: file 1
1698 test_expect_success SETUP
'rebuild HEAD log' '
1701 git update-ref -m "to empty main" HEAD "$mtcommit" HEAD &&
1703 git update-ref -m "allons master" HEAD master HEAD &&
1704 tg tag -g HEAD >actual &&
1705 test_cmp actual ../tgHEAD_main_new
1708 test "$test_hash_algo" != "sha1" ||
1709 cat <<\EOT
>tgHEAD_linked_new || die
1711 04eea982
15:15:13 (commit
) HEAD@
{0}: HEAD back
1712 2849f113
15:14:13 (commit
) HEAD@
{1}: allons linked
1713 b63866e5
15:13:13 (commit
) HEAD@
{2}: to empty linked
1716 test "$test_hash_algo" != "sha256" ||
1717 cat <<\EOT
>tgHEAD_linked_new || die
1719 6fda165d
15:15:13 (commit
) HEAD@
{0}: HEAD back
1720 e2473e86
15:14:13 (commit
) HEAD@
{1}: allons linked
1721 079309f2
15:13:13 (commit
) HEAD@
{2}: to empty linked
1724 test_expect_success
'SETUP GIT_2_5' 'rebuild HEAD log [linked]' '
1726 cur="$(git rev-parse --verify HEAD)" && test -n "$cur" &&
1728 git update-ref -m "to empty linked" HEAD "$mtcommit" HEAD &&
1730 git update-ref -m "allons linked" HEAD linked HEAD &&
1732 git update-ref -m "HEAD back" HEAD "$cur" &&
1733 tg tag -g HEAD >actual &&
1734 test_cmp actual ../tgHEAD_linked_new
1737 test "$test_hash_algo" != "sha1" ||
1738 cat <<\EOT
>tgHEAD_main_cleared || die
1739 commit c18fcef2dd73f7969b45b108d061309b670c886c
1740 Reflog
: HEAD@
{0} (Fra mewor k
(Committer
) <framework@example.org
>)
1741 Reflog message
: allons master
1742 Author
: Te s t
(Author
) <test@example.net
>
1743 AuthorDate
: Thu Apr
7 15:14:13 2005 -0700
1744 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
1745 CommitDate
: Thu Apr
7 15:14:13 2005 -0700
1750 test "$test_hash_algo" != "sha256" ||
1751 cat <<\EOT
>tgHEAD_main_cleared || die
1752 commit ecf5cd744123c8f322d61b4a97d18d75f1c25440ca838a9654decff6b8697226
1753 Reflog
: HEAD@
{0} (Fra mewor k
(Committer
) <framework@example.org
>)
1754 Reflog message
: allons master
1755 Author
: Te s t
(Author
) <test@example.net
>
1756 AuthorDate
: Thu Apr
7 15:14:13 2005 -0700
1757 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
1758 CommitDate
: Thu Apr
7 15:14:13 2005 -0700
1763 test_expect_success SETUP
'tag --clear HEAD' '
1765 tg tag --clear HEAD &&
1766 head -n 2 <../tgHEAD_main_new >expected &&
1767 tg tag -g HEAD >actual &&
1768 test_cmp actual expected &&
1769 tg tag --clear HEAD &&
1770 tg tag -g HEAD >actual &&
1771 test_cmp actual expected &&
1772 git log -g --pretty=fuller HEAD >actual &&
1773 test_cmp actual ../tgHEAD_main_cleared
1776 test "$test_hash_algo" != "sha1" ||
1777 cat <<\EOT
>tgHEAD_linked_cleared || die
1778 commit
04eea982f4572b35c7cbb6597f5d777661f15e60
1779 Reflog
: HEAD@
{0} (Fra mewor k
(Committer
) <framework@example.org
>)
1780 Reflog message
: HEAD back
1781 Author
: Te s t
(Author
) <test@example.net
>
1782 AuthorDate
: Thu Apr
7 15:20:13 2005 -0700
1783 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
1784 CommitDate
: Thu Apr
7 15:20:13 2005 -0700
1789 test "$test_hash_algo" != "sha256" ||
1790 cat <<\EOT
>tgHEAD_linked_cleared || die
1791 commit
6fda165d8aaa203d2bf9a67dcd750ac6e273489ea89e174866c1170d81cf2f73
1792 Reflog
: HEAD@
{0} (Fra mewor k
(Committer
) <framework@example.org
>)
1793 Reflog message
: HEAD back
1794 Author
: Te s t
(Author
) <test@example.net
>
1795 AuthorDate
: Thu Apr
7 15:20:13 2005 -0700
1796 Commit
: Fra mewor k
(Committer
) <framework@example.org
>
1797 CommitDate
: Thu Apr
7 15:20:13 2005 -0700
1802 test_expect_success
'SETUP GIT_2_5' 'tag --clear HEAD [linked]' '
1804 tg tag --clear HEAD &&
1805 head -n 2 <../tgHEAD_linked_new >expected &&
1806 tg tag -g HEAD >actual &&
1807 test_cmp actual expected &&
1808 tg tag --clear HEAD &&
1809 tg tag -g HEAD >actual &&
1810 test_cmp actual expected &&
1811 git log -g --pretty=fuller HEAD >actual &&
1812 test_cmp actual ../tgHEAD_linked_cleared
1815 test_expect_success
'SETUP GIT_2_5' 'tag --clear HEAD w/o log fails [linked]' '
1817 git rev-parse --verify HEAD@{0} >/dev/null -- &&
1818 tg tag --clear HEAD &&
1819 tg tag --drop HEAD@{0} &&
1820 test -e ../main/.git/worktrees/linked/logs/HEAD &&
1821 ! test -s ../main/.git/worktrees/linked/logs/HEAD &&
1822 test_must_fail tg tag --clear HEAD
1825 test_expect_success
'LASTOK SETUP GIT_2_5' \
1826 'HEAD@{0} after tag --clear and --drop @{0} [linked]' '
1827 result=test_must_fail &&
1828 { test -z "$git_231_plus" || result=; } &&
1830 test_must_fail git rev-parse --verify HEAD@{1} -- &&
1831 eval $result git rev-parse --verify HEAD@{0} --
1834 test_expect_success SETUP
'tag --clear HEAD w/o log fails' '
1836 git rev-parse --verify HEAD@{0} >/dev/null -- &&
1837 tg tag --clear HEAD &&
1838 tg tag --drop HEAD@{0} &&
1839 test -e .git/logs/HEAD &&
1840 ! test -s .git/logs/HEAD &&
1841 test_must_fail tg tag --clear HEAD
1844 test_expect_success
'LASTOK SETUP' \
1845 'HEAD@{0} after tag --clear and --drop @{0}' '
1846 result=test_must_fail &&
1847 { test -z "$git_231_plus" || result=; } &&
1849 test_must_fail git rev-parse --verify HEAD@{1} -- &&
1850 eval $result git rev-parse --verify HEAD@{0} --