tg.sh: handle help -h
[topgit/pro.git] / t / t4110-wayback-summary.sh
blob86169cc34bf3255378ed34dd70c4e6d6b323b485
1 #!/bin/sh
3 test_description='summary wayback in time'
5 TEST_NO_CREATE_REPO=1
7 . ./test-lib.sh
9 test_plan 7
11 sqt="$(test_get_temp squish)" || die not squishy
13 reset_repo() {
14 git read-tree --empty &&
15 git symbolic-ref HEAD refs/heads/orphan
18 squish() {
19 tab=" " # single tab in there
20 "$@" >"$sqt" || return
21 <"$sqt" tr -s "$tab" " "
24 topbases="$(tg --top-bases)" && test -n "$topbases" || die 'no top-bases!'
26 test_expect_success 'setup' '
27 test_create_repo pristine && cd pristine &&
28 git checkout --orphan rootcommit &&
29 git read-tree --empty &&
30 test_tick &&
31 git commit --allow-empty -m "empty root commit" &&
32 git tag rootcommit &&
33 tg_test_create_tag t/root &&
34 git checkout --orphan branch1 &&
35 git read-tree --empty &&
36 test_commit branch1-start &&
37 git checkout --orphan branch2 &&
38 git read-tree --empty &&
39 test_commit branch2-start &&
40 git checkout --orphan branch3 &&
41 git read-tree --empty &&
42 test_commit branch3-start &&
43 reset_repo &&
44 git clean -x -d -f &&
45 tg_test_create_tag t/branches &&
46 tg_test_create_tag t/branches-only "refs/heads/branch*" &&
47 tg_test_create_branches <<-EOT &&
48 rootbare bare empty root
51 rootmsg topmsg root
54 rootdeps --no-topmsg topdeps root
57 root standard root branch
60 annihilated annihilated branch
63 basebare bare base
64 ::rootcommit
66 +basebare bare base
67 :::basebare
69 t/branch1 branch1 topgit
70 branch1
72 t/branch2 branch2 topgit
73 branch2
75 t/branch3 branch3 topgit
76 branch3
77 EOT
78 tg_test_create_tag t/midway &&
79 tg_test_create_branches <<-EOT &&
80 reused-1level1 reused with one tg branch below
81 t/branch1
83 reused-2level1 reused with two tg branches below
84 t/branch1
85 t/branch2
87 reused-1level2 reused with one tg branch below
88 reused-1level1
90 reused-2level2 reused with two tg branches below
91 reused-1level1
92 reused-2level1
94 reused-multi multi-level reuse
95 reused-2level1
96 t/branch3
97 reused-2level2
98 EOT
99 tg_test_create_tag t/reused &&
100 tg_test_create_branches <<-EOT &&
101 boring just a boring commit here move along
104 t/subjmiss
105 boring
107 t/subjmt
108 boring
110 tg_test_create_tag t/boring1 refs/heads/boring "refs/heads/t/subj*" "$topbases/t/subj*" &&
111 tg_test_create_tag t/all1 &&
112 git checkout -f annihilated &&
113 test_tick &&
114 git commit --allow-empty -m "annihilated not empty" &&
115 git checkout -f t/branch2 &&
116 <.topmsg grep -v -i subject >.topmsg2 &&
117 mv -f .topmsg2 .topmsg &&
118 printf "%s\n" "subject:[PATCH] branch2" " topgit" >> .topmsg &&
119 git add .topmsg &&
120 test_tick &&
121 git commit -m ".topmsg: no space after subject colon" &&
122 git checkout -f t/subjmiss &&
123 <.topmsg grep -v -i subject >.topmsg2 &&
124 mv -f .topmsg2 .topmsg &&
125 git add .topmsg &&
126 test_tick &&
127 git commit -m ".topmsg: whoops, no subject: here" &&
128 git checkout -f t/subjmt &&
129 <.topmsg grep -v -i subject >.topmsg2 &&
130 mv -f .topmsg2 .topmsg &&
131 printf "%s\n" "subJECT: " >> .topmsg &&
132 git add .topmsg &&
133 test_tick &&
134 git commit -m ".topmsg: subject of emptyness" &&
135 tg_test_create_tag t/boring2 refs/heads/boring "refs/heads/t/subj*" "$topbases/t/subj*" &&
136 tg_test_create_tag t/all2 &&
137 reset_repo &&
138 git clean -x -d -f &&
139 cd .. &&
140 cp -pR pristine copy
143 printf "%s" "\
144 refs/heads/annihilated
145 refs/heads/basebare
146 refs/heads/boring
147 refs/heads/branch1
148 refs/heads/branch2
149 refs/heads/branch3
150 refs/heads/reused-1level1
151 refs/heads/reused-1level2
152 refs/heads/reused-2level1
153 refs/heads/reused-2level2
154 refs/heads/reused-multi
155 refs/heads/root
156 refs/heads/rootbare
157 refs/heads/rootcommit
158 refs/heads/rootdeps
159 refs/heads/rootmsg
160 refs/heads/t/branch1
161 refs/heads/t/branch2
162 refs/heads/t/branch3
163 refs/heads/t/subjmiss
164 refs/heads/t/subjmt
165 " > all_refsh || die failed to make all_refsh
167 printf "%s" "\
168 $topbases/annihilated
169 $topbases/basebare
170 $topbases/reused-1level1
171 $topbases/reused-1level2
172 $topbases/reused-2level1
173 $topbases/reused-2level2
174 $topbases/reused-multi
175 $topbases/root
176 $topbases/rootbare
177 $topbases/rootdeps
178 $topbases/rootmsg
179 $topbases/t/branch1
180 $topbases/t/branch2
181 $topbases/t/branch3
182 $topbases/t/subjmiss
183 $topbases/t/subjmt
184 " > all_refsb || die failed to make all_refsb
186 printf "%s" "\
187 refs/tags/branch1-start
188 refs/tags/branch2-start
189 refs/tags/branch3-start
190 refs/tags/rootcommit
191 refs/tags/t/all1
192 refs/tags/t/all2
193 refs/tags/t/boring1
194 refs/tags/t/boring2
195 refs/tags/t/branches
196 refs/tags/t/branches-only
197 refs/tags/t/midway
198 refs/tags/t/reused
199 refs/tags/t/root
200 " > all_refst || die failed to make all_refst
202 if test "$topbases" = "refs/top-bases"; then
203 cat all_refsh all_refst all_refsb > all_refs
204 else
205 cat all_refsh all_refsb all_refst > all_refs
206 fi || die failed to make all_refs
208 printf "%s" "\
209 refs/heads/annihilated
210 refs/heads/basebare
211 refs/heads/boring
212 refs/heads/branch1
213 refs/heads/branch2
214 refs/heads/branch3
215 refs/heads/reused-1level1
216 refs/heads/reused-1level2
217 refs/heads/reused-2level1
218 refs/heads/reused-2level2
219 refs/heads/reused-multi
220 refs/heads/root
221 refs/heads/rootbare
222 refs/heads/rootcommit
223 refs/heads/rootdeps
224 refs/heads/rootmsg
225 refs/heads/t/branch1
226 refs/heads/t/branch2
227 refs/heads/t/branch3
228 refs/heads/t/subjmiss
229 refs/heads/t/subjmt
230 $topbases/annihilated
231 $topbases/basebare
232 $topbases/reused-1level1
233 $topbases/reused-1level2
234 $topbases/reused-2level1
235 $topbases/reused-2level2
236 $topbases/reused-multi
237 $topbases/root
238 $topbases/rootbare
239 $topbases/rootdeps
240 $topbases/rootmsg
241 $topbases/t/branch1
242 $topbases/t/branch2
243 $topbases/t/branch3
244 $topbases/t/subjmiss
245 $topbases/t/subjmt
246 " > all_tg_refs || die failed to make all_tg_refs
248 printf "%s" "\
249 refs/heads/annihilated
250 refs/heads/basebare
251 refs/heads/branch1
252 refs/heads/branch2
253 refs/heads/branch3
254 refs/heads/root
255 refs/heads/rootbare
256 refs/heads/rootcommit
257 refs/heads/rootdeps
258 refs/heads/rootmsg
259 refs/heads/t/branch1
260 refs/heads/t/branch2
261 refs/heads/t/branch3
262 $topbases/annihilated
263 $topbases/basebare
264 $topbases/root
265 $topbases/rootbare
266 $topbases/rootdeps
267 $topbases/rootmsg
268 $topbases/t/branch1
269 $topbases/t/branch2
270 $topbases/t/branch3
271 " > midway_refs || die failed to make midway_refs
273 printf "%s" "\
274 refs/heads/annihilated
275 refs/heads/basebare
276 refs/heads/branch1
277 refs/heads/branch2
278 refs/heads/branch3
279 refs/heads/reused-1level1
280 refs/heads/reused-1level2
281 refs/heads/reused-2level1
282 refs/heads/reused-2level2
283 refs/heads/reused-multi
284 refs/heads/root
285 refs/heads/rootbare
286 refs/heads/rootcommit
287 refs/heads/rootdeps
288 refs/heads/rootmsg
289 refs/heads/t/branch1
290 refs/heads/t/branch2
291 refs/heads/t/branch3
292 $topbases/annihilated
293 $topbases/basebare
294 $topbases/reused-1level1
295 $topbases/reused-1level2
296 $topbases/reused-2level1
297 $topbases/reused-2level2
298 $topbases/reused-multi
299 $topbases/root
300 $topbases/rootbare
301 $topbases/rootdeps
302 $topbases/rootmsg
303 $topbases/t/branch1
304 $topbases/t/branch2
305 $topbases/t/branch3
306 " > reused_refs || die failed to make reused_refs
308 printf "%s" "\
309 refs/heads/boring
310 refs/heads/t/subjmiss
311 refs/heads/t/subjmt
312 $topbases/t/subjmiss
313 $topbases/t/subjmt
314 " > boring_refs || die failed to make boring_refs
316 squish printf "%s" "\
317 annihilated branch annihilated (annihilated)
318 basebare branch basebare (bare branch)
319 reused-1level1 [PATCH] reused with one tg branch below
320 reused-1level2 [PATCH] reused with one tg branch below
321 reused-2level1 [PATCH] reused with two tg branches below
322 reused-2level2 [PATCH] reused with two tg branches below
323 reused-multi [PATCH] multi-level reuse
324 root [PATCH] standard root branch
325 rootbare branch rootbare (no commits)
326 rootdeps branch rootdeps (missing .topmsg)
327 rootmsg [PATCH] topmsg root
328 t/branch1 [PATCH] branch1 topgit
329 t/branch2 [PATCH] branch2 topgit
330 t/branch3 [PATCH] branch3 topgit
331 t/subjmiss branch t/subjmiss (missing \"Subject:\" in .topmsg)
332 t/subjmt branch t/subjmt (empty \"Subject:\" in .topmsg)
333 " > pristine_full_list || die failed to make pristine_full_list
335 squish printf "%s" "\
336 annihilated branch annihilated (annihilated)
337 basebare branch basebare (bare branch)
338 reused-1level1 [PATCH] reused with one tg branch below
339 reused-1level2 [PATCH] reused with one tg branch below
340 reused-2level1 [PATCH] reused with two tg branches below
341 reused-2level2 [PATCH] reused with two tg branches below
342 reused-multi [PATCH] multi-level reuse
343 root [PATCH] standard root branch
344 rootbare branch rootbare (no commits)
345 rootdeps branch rootdeps (missing .topmsg)
346 rootmsg [PATCH] topmsg root
347 t/branch1 [PATCH] branch1 topgit
348 t/branch2 [PATCH] branch2 topgit
349 t/branch3 [PATCH] branch3 topgit
350 t/subjmiss [PATCH] branch t/subjmiss
351 t/subjmt [PATCH] branch t/subjmt
352 " > pristine_boring_list || die failed to make pristine_boring_list
354 squish printf "%s" "\
355 annihilated branch annihilated (no commits)
356 basebare branch basebare (bare branch)
357 reused-1level1 [PATCH] reused with one tg branch below
358 reused-1level2 [PATCH] reused with one tg branch below
359 reused-2level1 [PATCH] reused with two tg branches below
360 reused-2level2 [PATCH] reused with two tg branches below
361 reused-multi [PATCH] multi-level reuse
362 root [PATCH] standard root branch
363 rootbare branch rootbare (no commits)
364 rootdeps branch rootdeps (missing .topmsg)
365 rootmsg [PATCH] topmsg root
366 t/branch1 [PATCH] branch1 topgit
367 t/branch2 [PATCH] branch2 topgit
368 t/branch3 [PATCH] branch3 topgit
369 t/subjmiss branch t/subjmiss (missing \"Subject:\" in .topmsg)
370 t/subjmt branch t/subjmt (empty \"Subject:\" in .topmsg)
371 " > pristine_fullb4_list || die failed to make pristine_fullb4_list
373 squish printf "%s" "\
374 annihilated branch annihilated (no commits)
375 basebare branch basebare (bare branch)
376 reused-1level1 [PATCH] reused with one tg branch below
377 reused-1level2 [PATCH] reused with one tg branch below
378 reused-2level1 [PATCH] reused with two tg branches below
379 reused-2level2 [PATCH] reused with two tg branches below
380 reused-multi [PATCH] multi-level reuse
381 root [PATCH] standard root branch
382 rootbare branch rootbare (no commits)
383 rootdeps branch rootdeps (missing .topmsg)
384 rootmsg [PATCH] topmsg root
385 t/branch1 [PATCH] branch1 topgit
386 t/branch2 [PATCH] branch2 topgit
387 t/branch3 [PATCH] branch3 topgit
388 t/subjmiss [PATCH] branch t/subjmiss
389 t/subjmt [PATCH] branch t/subjmt
390 " > pristine_boringb4_list || die failed to make pristine_boring_list
392 squish printf "%s" "\
393 annihilated branch annihilated (no commits)
394 basebare branch basebare (bare branch)
395 reused-1level1 [PATCH] reused with one tg branch below
396 reused-1level2 [PATCH] reused with one tg branch below
397 reused-2level1 [PATCH] reused with two tg branches below
398 reused-2level2 [PATCH] reused with two tg branches below
399 reused-multi [PATCH] multi-level reuse
400 root [PATCH] standard root branch
401 rootbare branch rootbare (no commits)
402 rootdeps branch rootdeps (missing .topmsg)
403 rootmsg [PATCH] topmsg root
404 t/branch1 [PATCH] branch1 topgit
405 t/branch2 [PATCH] branch2 topgit
406 t/branch3 [PATCH] branch3 topgit
407 t/subjmiss branch t/subjmiss (missing \"Subject:\" in .topmsg)
408 t/subjmt branch t/subjmt (empty \"Subject:\" in .topmsg)
409 " > pristine_fullb4b1_list || die failed to make pristine_fullb4b1_list
411 squish printf "%s" "\
412 annihilated branch annihilated (no commits)
413 basebare branch basebare (bare branch)
414 root [PATCH] standard root branch
415 rootbare branch rootbare (no commits)
416 rootdeps branch rootdeps (missing .topmsg)
417 rootmsg [PATCH] topmsg root
418 t/branch1 [PATCH] branch1 topgit
419 t/branch2 [PATCH] branch2 topgit
420 t/branch3 [PATCH] branch3 topgit
421 " > pristine_midway_list || die failed to make pristine_midway_list
423 squish printf "%s" "\
424 annihilated branch annihilated (no commits)
425 basebare branch basebare (bare branch)
426 reused-1level1 [PATCH] reused with one tg branch below
427 reused-1level2 [PATCH] reused with one tg branch below
428 reused-2level1 [PATCH] reused with two tg branches below
429 reused-2level2 [PATCH] reused with two tg branches below
430 reused-multi [PATCH] multi-level reuse
431 root [PATCH] standard root branch
432 rootbare branch rootbare (no commits)
433 rootdeps branch rootdeps (missing .topmsg)
434 rootmsg [PATCH] topmsg root
435 t/branch1 [PATCH] branch1 topgit
436 t/branch2 [PATCH] branch2 topgit
437 t/branch3 [PATCH] branch3 topgit
438 " > pristine_reused_list || die failed to make pristine_reused_list
440 squish printf "%s" "\
441 t/subjmiss [PATCH] branch t/subjmiss
442 t/subjmt [PATCH] branch t/subjmt
443 " > pristine_boring1_list || die failed to make pristine_boring1_list
445 squish printf "%s" "\
446 t/subjmiss branch t/subjmiss (missing \"Subject:\" in .topmsg)
447 t/subjmt branch t/subjmt (empty \"Subject:\" in .topmsg)
448 " > pristine_boring2_list || die failed to make pristine_boring2_list
450 squish printf "%s" "\
451 basebare branch basebare (bare branch)
452 0 reused-1level1 [PATCH] reused with one tg branch below
453 0 reused-1level2 [PATCH] reused with one tg branch below
454 0 D * reused-2level1 [PATCH] reused with two tg branches below
455 0 D * reused-2level2 [PATCH] reused with two tg branches below
456 0 D reused-multi [PATCH] multi-level reuse
457 0 root [PATCH] standard root branch
458 0 rootdeps branch rootdeps (missing .topmsg)
459 0 rootmsg [PATCH] topmsg root
460 0 t/branch1 [PATCH] branch1 topgit
461 0 * t/branch2 [PATCH] branch2 topgit
462 0 * t/branch3 [PATCH] branch3 topgit
463 0 t/subjmiss branch t/subjmiss (missing \"Subject:\" in .topmsg)
464 0 t/subjmt branch t/subjmt (empty \"Subject:\" in .topmsg)
465 " > pristine_full_summary || die failed to make pristine_full_summary
467 squish printf "%s" "\
468 basebare branch basebare (bare branch)
469 0 reused-1level1 [PATCH] reused with one tg branch below
470 0 reused-1level2 [PATCH] reused with one tg branch below
471 0 D * reused-2level1 [PATCH] reused with two tg branches below
472 0 D * reused-2level2 [PATCH] reused with two tg branches below
473 0 D reused-multi [PATCH] multi-level reuse
474 0 root [PATCH] standard root branch
475 0 rootdeps branch rootdeps (missing .topmsg)
476 0 rootmsg [PATCH] topmsg root
477 0 t/branch1 [PATCH] branch1 topgit
478 0 * t/branch2 [PATCH] branch2 topgit
479 0 * t/branch3 [PATCH] branch3 topgit
480 0 t/subjmiss [PATCH] branch t/subjmiss
481 0 t/subjmt [PATCH] branch t/subjmt
482 " > pristine_boring_summary || die failed to make pristine_boring_summary
484 squish printf "%s" "\
485 basebare branch basebare (bare branch)
486 0 root [PATCH] standard root branch
487 0 rootdeps branch rootdeps (missing .topmsg)
488 0 rootmsg [PATCH] topmsg root
489 0 t/branch1 [PATCH] branch1 topgit
490 0 t/branch2 [PATCH] branch2 topgit
491 0 t/branch3 [PATCH] branch3 topgit
492 " > pristine_midway_summary || die failed to make pristine_midway_summary
494 squish printf "%s" "\
495 basebare branch basebare (bare branch)
496 0 reused-1level1 [PATCH] reused with one tg branch below
497 0 reused-1level2 [PATCH] reused with one tg branch below
498 0 D * reused-2level1 [PATCH] reused with two tg branches below
499 0 D * reused-2level2 [PATCH] reused with two tg branches below
500 0 D reused-multi [PATCH] multi-level reuse
501 0 root [PATCH] standard root branch
502 0 rootdeps branch rootdeps (missing .topmsg)
503 0 rootmsg [PATCH] topmsg root
504 0 t/branch1 [PATCH] branch1 topgit
505 0 * t/branch2 [PATCH] branch2 topgit
506 0 * t/branch3 [PATCH] branch3 topgit
507 " > pristine_reused_summary || die failed to make pristine_reused_summary
509 squish printf "%s" "\
510 0 t/subjmiss [PATCH] branch t/subjmiss
511 0 t/subjmt [PATCH] branch t/subjmt
512 " > pristine_boring1_summary || die failed to make pristine_boring1_summary
514 squish printf "%s" "\
515 0 t/subjmiss branch t/subjmiss (missing \"Subject:\" in .topmsg)
516 0 t/subjmt branch t/subjmt (empty \"Subject:\" in .topmsg)
517 " > pristine_boring2_summary || die failed to make pristine_boring2_summary
519 test_expect_success 'verify list' '
520 squish tg -C copy summary -vvl >actual &&
521 test_diff pristine_full_list actual &&
522 squish tg -C copy -w : summary -vvl > actual &&
523 test_diff pristine_full_list actual &&
524 squish tg -C copy -w : summary -vvl > actual &&
525 test_diff pristine_full_list actual &&
526 squish tg -C copy -w : shell tg summary -vvl > actual &&
527 test_diff pristine_full_list actual &&
528 squish tg -C copy -w t/all2 summary -vvl > actual &&
529 test_diff pristine_full_list actual &&
530 squish tg -C copy -w t/all2 shell tg summary -vvl> actual &&
531 test_diff pristine_full_list actual
534 test_expect_success 'verify summary' '
535 squish tg -C copy summary >actual &&
536 test_diff pristine_full_summary actual &&
537 squish tg -C copy -w : summary > actual &&
538 test_diff pristine_full_summary actual &&
539 squish tg -C copy -w : summary > actual &&
540 test_diff pristine_full_summary actual &&
541 squish tg -C copy -w : shell tg summary > actual &&
542 test_diff pristine_full_summary actual &&
543 squish tg -C copy -w t/all2 summary > actual &&
544 test_diff pristine_full_summary actual &&
545 squish tg -C copy -w t/all2 shell tg summary > actual &&
546 test_diff pristine_full_summary actual
549 test_expect_success 'wayback list' '
550 >expected &&
551 for wtag in t/root t/branches t/branches-only; do
552 squish tg -C copy -w "$wtag" summary -vvl >actual &&
553 test_diff pristine_full_list actual &&
554 tg -C copy -w ":$wtag" summary -vvl >actual &&
555 test_diff expected actual || return
556 done &&
557 squish tg -C copy -w t/midway summary -vvl >actual &&
558 test_diff pristine_fullb4_list actual &&
559 squish tg -C copy -w :t/midway summary -vvl >actual &&
560 test_diff pristine_midway_list actual &&
561 squish tg -C copy -w t/reused summary -vvl >actual &&
562 test_diff pristine_fullb4_list actual &&
563 squish tg -C copy -w :t/reused summary -vvl >actual &&
564 test_diff pristine_reused_list actual &&
565 squish tg -C copy -w t/boring1 summary -vvl >actual &&
566 test_diff pristine_boring_list actual &&
567 squish tg -C copy -w :t/boring1 summary -vvl >actual &&
568 test_diff pristine_boring1_list actual &&
569 squish tg -C copy -w t/all1 summary -vvl >actual &&
570 test_diff pristine_boringb4_list actual &&
571 squish tg -C copy -w :t/all1 summary -vvl >actual &&
572 test_diff pristine_boringb4_list actual &&
573 squish tg -C copy -w t/boring2 summary -vvl >actual &&
574 test_diff pristine_full_list actual &&
575 squish tg -C copy -w :t/boring2 summary -vvl >actual &&
576 test_diff pristine_boring2_list actual
579 test_expect_success 'wayback summary' '
580 >expected &&
581 for wtag in t/root t/branches t/branches-only; do
582 squish tg -C copy -w "$wtag" summary >actual &&
583 test_diff pristine_full_summary actual &&
584 tg -C copy -w ":$wtag" summary >actual &&
585 test_diff expected actual || return
586 done &&
587 squish tg -C copy -w t/midway summary >actual &&
588 test_diff pristine_full_summary actual &&
589 squish tg -C copy -w :t/midway summary >actual &&
590 test_diff pristine_midway_summary actual &&
591 squish tg -C copy -w t/reused summary >actual &&
592 test_diff pristine_full_summary actual &&
593 squish tg -C copy -w :t/reused summary >actual &&
594 test_diff pristine_reused_summary actual &&
595 squish tg -C copy -w t/boring1 summary >actual &&
596 test_diff pristine_boring_summary actual &&
597 squish tg -C copy -w :t/boring1 summary >actual &&
598 test_diff pristine_boring1_summary actual &&
599 squish tg -C copy -w t/all1 summary >actual &&
600 test_diff pristine_boring_summary actual &&
601 squish tg -C copy -w :t/all1 summary >actual &&
602 test_diff pristine_boring_summary actual &&
603 squish tg -C copy -w t/boring2 summary >actual &&
604 test_diff pristine_full_summary actual &&
605 squish tg -C copy -w :t/boring2 summary >actual &&
606 test_diff pristine_boring2_summary actual
609 test_expect_success 'wayback refs' '
610 printf "%s\n" "refs/heads/rootcommit" >expected &&
611 tg -C copy -w t/root shell git for-each-ref --format="%\\(refname\\)" > actual &&
612 test_diff all_refs actual &&
613 tg -C copy -w :t/root shell git for-each-ref --format="%\\(refname\\)" > actual &&
614 test_diff expected actual &&
615 printf "%s\n" "refs/heads/branch1" "refs/heads/branch2" "refs/heads/branch3" \
616 "refs/heads/rootcommit" >expected &&
617 tg -C copy -w t/branches shell -q git for-each-ref --format="%(refname)" > actual &&
618 test_diff all_refs actual &&
619 tg -C copy -w :t/branches shell -q git for-each-ref --format="%(refname)" > actual &&
620 test_diff expected actual &&
621 printf "%s\n" "refs/heads/branch1" "refs/heads/branch2" "refs/heads/branch3" >expected &&
622 tg -C copy -w t/branches-only shell -q git for-each-ref --format="%(refname)" > actual &&
623 test_diff all_refs actual &&
624 tg -C copy -w :t/branches-only shell -q git for-each-ref --format="%(refname)" > actual &&
625 test_diff expected actual &&
626 tg -C copy -w t/midway shell -q git for-each-ref --format="%(refname)" > actual &&
627 test_diff all_refs actual &&
628 tg -C copy -w :t/midway shell -q git for-each-ref --format="%(refname)" > actual &&
629 test_diff midway_refs actual &&
630 tg -C copy -w t/reused shell -q git for-each-ref --format="%(refname)" > actual &&
631 test_diff all_refs actual &&
632 tg -C copy -w :t/reused shell -q git for-each-ref --format="%(refname)" > actual &&
633 test_diff reused_refs actual &&
634 tg -C copy -w t/all1 shell -q git for-each-ref --format="%(refname)" > actual &&
635 test_diff all_refs actual &&
636 tg -C copy -w :t/all1 shell -q git for-each-ref --format="%(refname)" > actual &&
637 test_diff all_tg_refs actual &&
638 tg -C copy -w t/boring1 shell -q git for-each-ref --format="%(refname)" > actual &&
639 test_diff all_refs actual &&
640 tg -C copy -w :t/boring1 shell -q git for-each-ref --format="%(refname)" > actual &&
641 test_diff boring_refs actual &&
642 tg -C copy -w t/all2 shell -q git for-each-ref --format="%(refname)" > actual &&
643 test_diff all_refs actual &&
644 tg -C copy -w :t/all2 shell -q git for-each-ref --format="%(refname)" > actual &&
645 test_diff all_tg_refs actual &&
646 tg -C copy -w t/boring2 shell -q git for-each-ref --format="%(refname)" > actual &&
647 test_diff all_refs actual &&
648 tg -C copy -w :t/boring2 shell -q git for-each-ref --format="%(refname)" > actual &&
649 test_diff boring_refs actual
652 test_expect_success 'wayback directory refs' '
653 tg -C copy -w :t/midway shell --directory "$PWD/newdir" : &&
654 git -C newdir for-each-ref --format="%(refname)" > actual &&
655 test_diff midway_refs actual
658 test_done