]> git.ipfire.org Git - thirdparty/git.git/blob - t/t7700-repack.sh
t9001: fix indentation in test_no_confirm()
[thirdparty/git.git] / t / t7700-repack.sh
1 #!/bin/sh
2
3 test_description='git repack works correctly'
4
5 . ./test-lib.sh
6 . "${TEST_DIRECTORY}/lib-bitmap.sh"
7 . "${TEST_DIRECTORY}/lib-midx.sh"
8 . "${TEST_DIRECTORY}/lib-terminal.sh"
9
10 commit_and_pack () {
11 test_commit "$@" 1>&2 &&
12 incrpackid=$(git pack-objects --all --unpacked --incremental .git/objects/pack/pack </dev/null) &&
13 echo pack-${incrpackid}.pack
14 }
15
16 test_no_missing_in_packs () {
17 myidx=$(ls -1 .git/objects/pack/*.idx) &&
18 test_path_is_file "$myidx" &&
19 git verify-pack -v alt_objects/pack/*.idx >orig.raw &&
20 sed -n -e "s/^\($OID_REGEX\).*/\1/p" orig.raw | sort >orig &&
21 git verify-pack -v $myidx >dest.raw &&
22 cut -d" " -f1 dest.raw | sort >dest &&
23 comm -23 orig dest >missing &&
24 test_must_be_empty missing
25 }
26
27 # we expect $packid and $oid to be defined
28 test_has_duplicate_object () {
29 want_duplicate_object="$1"
30 found_duplicate_object=false
31 for p in .git/objects/pack/*.idx
32 do
33 idx=$(basename $p)
34 test "pack-$packid.idx" = "$idx" && continue
35 git verify-pack -v $p >packlist || return $?
36 if grep "^$oid" packlist
37 then
38 found_duplicate_object=true
39 echo "DUPLICATE OBJECT FOUND"
40 break
41 fi
42 done &&
43 test "$want_duplicate_object" = "$found_duplicate_object"
44 }
45
46 test_expect_success 'objects in packs marked .keep are not repacked' '
47 echo content1 >file1 &&
48 echo content2 >file2 &&
49 git add . &&
50 test_tick &&
51 git commit -m initial_commit &&
52 # Create two packs
53 # The first pack will contain all of the objects except one
54 git rev-list --objects --all >objs &&
55 grep -v file2 objs | git pack-objects pack &&
56 # The second pack will contain the excluded object
57 packid=$(grep file2 objs | git pack-objects pack) &&
58 >pack-$packid.keep &&
59 git verify-pack -v pack-$packid.idx >packlist &&
60 oid=$(head -n 1 packlist | sed -e "s/^\($OID_REGEX\).*/\1/") &&
61 mv pack-* .git/objects/pack/ &&
62 git repack -A -d -l &&
63 git prune-packed &&
64 test_has_duplicate_object false
65 '
66
67 test_expect_success 'writing bitmaps via command-line can duplicate .keep objects' '
68 # build on $oid, $packid, and .keep state from previous
69 GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 git repack -Adbl &&
70 test_has_duplicate_object true
71 '
72
73 test_expect_success 'writing bitmaps via config can duplicate .keep objects' '
74 # build on $oid, $packid, and .keep state from previous
75 GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
76 git -c repack.writebitmaps=true repack -Adl &&
77 test_has_duplicate_object true
78 '
79
80 test_expect_success 'loose objects in alternate ODB are not repacked' '
81 mkdir alt_objects &&
82 echo $(pwd)/alt_objects >.git/objects/info/alternates &&
83 echo content3 >file3 &&
84 oid=$(GIT_OBJECT_DIRECTORY=alt_objects git hash-object -w file3) &&
85 git add file3 &&
86 test_tick &&
87 git commit -m commit_file3 &&
88 git repack -a -d -l &&
89 git prune-packed &&
90 test_has_duplicate_object false
91 '
92
93 test_expect_success SYMLINKS '--local keeps packs when alternate is objectdir ' '
94 test_when_finished "rm -rf repo" &&
95 git init repo &&
96 test_commit -C repo A &&
97 (
98 cd repo &&
99 git repack -a &&
100 ls .git/objects/pack/*.pack >../expect &&
101 ln -s objects .git/alt_objects &&
102 echo "$(pwd)/.git/alt_objects" >.git/objects/info/alternates &&
103 git repack -a -d -l &&
104 ls .git/objects/pack/*.pack >../actual
105 ) &&
106 test_cmp expect actual
107 '
108
109 test_expect_success 'packed obs in alt ODB are repacked even when local repo is packless' '
110 mkdir alt_objects/pack &&
111 mv .git/objects/pack/* alt_objects/pack &&
112 git repack -a &&
113 test_no_missing_in_packs
114 '
115
116 test_expect_success 'packed obs in alt ODB are repacked when local repo has packs' '
117 rm -f .git/objects/pack/* &&
118 echo new_content >>file1 &&
119 git add file1 &&
120 test_tick &&
121 git commit -m more_content &&
122 git repack &&
123 git repack -a -d &&
124 test_no_missing_in_packs
125 '
126
127 test_expect_success 'packed obs in alternate ODB kept pack are repacked' '
128 # swap the .keep so the commit object is in the pack with .keep
129 for p in alt_objects/pack/*.pack
130 do
131 base_name=$(basename $p .pack) &&
132 if test_path_is_file alt_objects/pack/$base_name.keep
133 then
134 rm alt_objects/pack/$base_name.keep
135 else
136 touch alt_objects/pack/$base_name.keep
137 fi || return 1
138 done &&
139 git repack -a -d &&
140 test_no_missing_in_packs
141 '
142
143 test_expect_success 'packed unreachable obs in alternate ODB are not loosened' '
144 rm -f alt_objects/pack/*.keep &&
145 mv .git/objects/pack/* alt_objects/pack/ &&
146 coid=$(git rev-parse HEAD^{commit}) &&
147 git reset --hard HEAD^ &&
148 test_tick &&
149 git reflog expire --expire=$test_tick --expire-unreachable=$test_tick --all &&
150 # The pack-objects call on the next line is equivalent to
151 # git repack -A -d without the call to prune-packed
152 git pack-objects --honor-pack-keep --non-empty --all --reflog \
153 --unpack-unreachable </dev/null pack &&
154 rm -f .git/objects/pack/* &&
155 mv pack-* .git/objects/pack/ &&
156 git verify-pack -v -- .git/objects/pack/*.idx >packlist &&
157 ! grep "^$coid " packlist &&
158 echo >.git/objects/info/alternates &&
159 test_must_fail git show $coid
160 '
161
162 test_expect_success 'local packed unreachable obs that exist in alternate ODB are not loosened' '
163 echo $(pwd)/alt_objects >.git/objects/info/alternates &&
164 echo "$coid" | git pack-objects --non-empty --all --reflog pack &&
165 rm -f .git/objects/pack/* &&
166 mv pack-* .git/objects/pack/ &&
167 # The pack-objects call on the next line is equivalent to
168 # git repack -A -d without the call to prune-packed
169 git pack-objects --honor-pack-keep --non-empty --all --reflog \
170 --unpack-unreachable </dev/null pack &&
171 rm -f .git/objects/pack/* &&
172 mv pack-* .git/objects/pack/ &&
173 git verify-pack -v -- .git/objects/pack/*.idx >packlist &&
174 ! grep "^$coid " &&
175 echo >.git/objects/info/alternates &&
176 test_must_fail git show $coid
177 '
178
179 test_expect_success 'objects made unreachable by grafts only are kept' '
180 test_tick &&
181 git commit --allow-empty -m "commit 4" &&
182 H0=$(git rev-parse HEAD) &&
183 H1=$(git rev-parse HEAD^) &&
184 H2=$(git rev-parse HEAD^^) &&
185 echo "$H0 $H2" >.git/info/grafts &&
186 git reflog expire --expire=$test_tick --expire-unreachable=$test_tick --all &&
187 git repack -a -d &&
188 git cat-file -t $H1
189 '
190
191 test_expect_success 'repack --keep-pack' '
192 test_create_repo keep-pack &&
193 (
194 cd keep-pack &&
195 P1=$(commit_and_pack 1) &&
196 P2=$(commit_and_pack 2) &&
197 P3=$(commit_and_pack 3) &&
198 P4=$(commit_and_pack 4) &&
199 ls .git/objects/pack/*.pack >old-counts &&
200 test_line_count = 4 old-counts &&
201 git repack -a -d --keep-pack $P1 --keep-pack $P4 &&
202 ls .git/objects/pack/*.pack >new-counts &&
203 grep -q $P1 new-counts &&
204 grep -q $P4 new-counts &&
205 test_line_count = 3 new-counts &&
206 git fsck
207 )
208 '
209
210 test_expect_success 'bitmaps are created by default in bare repos' '
211 git clone --bare .git bare.git &&
212 rm -f bare.git/objects/pack/*.bitmap &&
213 GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
214 git -C bare.git repack -ad &&
215 bitmap=$(ls bare.git/objects/pack/*.bitmap) &&
216 test_path_is_file "$bitmap"
217 '
218
219 test_expect_success 'incremental repack does not complain' '
220 git -C bare.git repack -q 2>repack.err &&
221 test_must_be_empty repack.err
222 '
223
224 test_expect_success 'bitmaps can be disabled on bare repos' '
225 GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
226 git -c repack.writeBitmaps=false -C bare.git repack -ad &&
227 bitmap=$(ls bare.git/objects/pack/*.bitmap || :) &&
228 test -z "$bitmap"
229 '
230
231 test_expect_success 'no bitmaps created if .keep files present' '
232 pack=$(ls bare.git/objects/pack/*.pack) &&
233 test_path_is_file "$pack" &&
234 keep=${pack%.pack}.keep &&
235 test_when_finished "rm -f \"\$keep\"" &&
236 >"$keep" &&
237 GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
238 git -C bare.git repack -ad 2>stderr &&
239 test_must_be_empty stderr &&
240 find bare.git/objects/pack/ -type f -name "*.bitmap" >actual &&
241 test_must_be_empty actual
242 '
243
244 test_expect_success 'auto-bitmaps do not complain if unavailable' '
245 test_config -C bare.git pack.packSizeLimit 1M &&
246 blob=$(test-tool genrandom big $((1024*1024)) |
247 git -C bare.git hash-object -w --stdin) &&
248 git -C bare.git update-ref refs/tags/big $blob &&
249 GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 \
250 git -C bare.git repack -ad 2>stderr &&
251 test_must_be_empty stderr &&
252 find bare.git/objects/pack -type f -name "*.bitmap" >actual &&
253 test_must_be_empty actual
254 '
255
256 objdir=.git/objects
257 midx=$objdir/pack/multi-pack-index
258
259 test_expect_success 'setup for --write-midx tests' '
260 git init midx &&
261 (
262 cd midx &&
263 git config core.multiPackIndex true &&
264
265 test_commit base
266 )
267 '
268
269 test_expect_success '--write-midx unchanged' '
270 (
271 cd midx &&
272 GIT_TEST_MULTI_PACK_INDEX=0 git repack &&
273 test_path_is_missing $midx &&
274 test_path_is_missing $midx-*.bitmap &&
275
276 GIT_TEST_MULTI_PACK_INDEX=0 git repack --write-midx &&
277
278 test_path_is_file $midx &&
279 test_path_is_missing $midx-*.bitmap &&
280 test_midx_consistent $objdir
281 )
282 '
283
284 test_expect_success '--write-midx with a new pack' '
285 (
286 cd midx &&
287 test_commit loose &&
288
289 GIT_TEST_MULTI_PACK_INDEX=0 git repack --write-midx &&
290
291 test_path_is_file $midx &&
292 test_path_is_missing $midx-*.bitmap &&
293 test_midx_consistent $objdir
294 )
295 '
296
297 test_expect_success '--write-midx with -b' '
298 (
299 cd midx &&
300 GIT_TEST_MULTI_PACK_INDEX=0 git repack -mb &&
301
302 test_path_is_file $midx &&
303 test_path_is_file $midx-*.bitmap &&
304 test_midx_consistent $objdir
305 )
306 '
307
308 test_expect_success '--write-midx with -d' '
309 (
310 cd midx &&
311 test_commit repack &&
312
313 GIT_TEST_MULTI_PACK_INDEX=0 git repack -Ad --write-midx &&
314
315 test_path_is_file $midx &&
316 test_path_is_missing $midx-*.bitmap &&
317 test_midx_consistent $objdir
318 )
319 '
320
321 test_expect_success 'cleans up MIDX when appropriate' '
322 (
323 cd midx &&
324
325 test_commit repack-2 &&
326 GIT_TEST_MULTI_PACK_INDEX=0 git repack -Adb --write-midx &&
327
328 checksum=$(midx_checksum $objdir) &&
329 test_path_is_file $midx &&
330 test_path_is_file $midx-$checksum.bitmap &&
331
332 test_commit repack-3 &&
333 GIT_TEST_MULTI_PACK_INDEX=0 git repack -Adb --write-midx &&
334
335 test_path_is_file $midx &&
336 test_path_is_missing $midx-$checksum.bitmap &&
337 test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&
338
339 test_commit repack-4 &&
340 GIT_TEST_MULTI_PACK_INDEX=0 git repack -Adb &&
341
342 find $objdir/pack -type f -name "multi-pack-index*" >files &&
343 test_must_be_empty files
344 )
345 '
346
347 test_expect_success '--write-midx with preferred bitmap tips' '
348 git init midx-preferred-tips &&
349 test_when_finished "rm -fr midx-preferred-tips" &&
350 (
351 cd midx-preferred-tips &&
352
353 test_commit_bulk --message="%s" 103 &&
354
355 git log --format="%H" >commits.raw &&
356 sort <commits.raw >commits &&
357
358 git log --format="create refs/tags/%s/%s %H" HEAD >refs &&
359 git update-ref --stdin <refs &&
360
361 git repack --write-midx --write-bitmap-index &&
362 test_path_is_file $midx &&
363 test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&
364
365 test-tool bitmap list-commits | sort >bitmaps &&
366 comm -13 bitmaps commits >before &&
367 test_line_count = 1 before &&
368
369 rm -fr $midx-$(midx_checksum $objdir).bitmap &&
370 rm -fr $midx &&
371
372 # instead of constructing the snapshot ourselves (c.f., the test
373 # "write a bitmap with --refs-snapshot (preferred tips)" in
374 # t5326), mark the missing commit as preferred by adding it to
375 # the pack.preferBitmapTips configuration.
376 git for-each-ref --format="%(refname:rstrip=1)" \
377 --points-at="$(cat before)" >missing &&
378 git config pack.preferBitmapTips "$(cat missing)" &&
379 git repack --write-midx --write-bitmap-index &&
380
381 test-tool bitmap list-commits | sort >bitmaps &&
382 comm -13 bitmaps commits >after &&
383
384 ! test_cmp before after
385 )
386 '
387
388 # The first argument is expected to be a filename
389 # and that file should contain the name of a .idx
390 # file. Send the list of objects in that .idx file
391 # into stdout.
392 get_sorted_objects_from_pack () {
393 git show-index <$(cat "$1") >raw &&
394 cut -d" " -f2 raw
395 }
396
397 test_expect_success '--write-midx -b packs non-kept objects' '
398 git init repo &&
399 test_when_finished "rm -fr repo" &&
400 (
401 cd repo &&
402
403 # Create a kept pack-file
404 test_commit base &&
405 git repack -ad &&
406 find $objdir/pack -name "*.idx" >before &&
407 test_line_count = 1 before &&
408 before_name=$(cat before) &&
409 >${before_name%.idx}.keep &&
410
411 # Create a non-kept pack-file
412 test_commit other &&
413 git repack &&
414
415 # Create loose objects
416 test_commit loose &&
417
418 # Repack everything
419 git repack --write-midx -a -b -d &&
420
421 # There should be two pack-files now, the
422 # old, kept pack and the new, non-kept pack.
423 find $objdir/pack -name "*.idx" | sort >after &&
424 test_line_count = 2 after &&
425 find $objdir/pack -name "*.keep" >kept &&
426 kept_name=$(cat kept) &&
427 echo ${kept_name%.keep}.idx >kept-idx &&
428 test_cmp before kept-idx &&
429
430 # Get object list from the kept pack.
431 get_sorted_objects_from_pack before >old.objects &&
432
433 # Get object list from the one non-kept pack-file
434 comm -13 before after >new-pack &&
435 test_line_count = 1 new-pack &&
436 get_sorted_objects_from_pack new-pack >new.objects &&
437
438 # None of the objects in the new pack should
439 # exist within the kept pack.
440 comm -12 old.objects new.objects >shared.objects &&
441 test_must_be_empty shared.objects
442 )
443 '
444
445 test_expect_success '--write-midx removes stale pack-based bitmaps' '
446 rm -fr repo &&
447 git init repo &&
448 test_when_finished "rm -fr repo" &&
449 (
450 cd repo &&
451 test_commit base &&
452 GIT_TEST_MULTI_PACK_INDEX=0 git repack -Ab &&
453
454 pack_bitmap=$(ls $objdir/pack/pack-*.bitmap) &&
455 test_path_is_file "$pack_bitmap" &&
456
457 test_commit tip &&
458 GIT_TEST_MULTI_PACK_INDEX=0 git repack -bm &&
459
460 test_path_is_file $midx &&
461 test_path_is_file $midx-$(midx_checksum $objdir).bitmap &&
462 test_path_is_missing $pack_bitmap
463 )
464 '
465
466 test_expect_success '--write-midx with --pack-kept-objects' '
467 git init repo &&
468 test_when_finished "rm -fr repo" &&
469 (
470 cd repo &&
471
472 test_commit one &&
473 test_commit two &&
474
475 one="$(echo "one" | git pack-objects --revs $objdir/pack/pack)" &&
476 two="$(echo "one..two" | git pack-objects --revs $objdir/pack/pack)" &&
477
478 keep="$objdir/pack/pack-$one.keep" &&
479 touch "$keep" &&
480
481 git repack --write-midx --write-bitmap-index --geometric=2 -d \
482 --pack-kept-objects &&
483
484 test_path_is_file $keep &&
485 test_path_is_file $midx &&
486 test_path_is_file $midx-$(midx_checksum $objdir).bitmap
487 )
488 '
489
490 test_expect_success TTY '--quiet disables progress' '
491 test_terminal env GIT_PROGRESS_DELAY=0 \
492 git -C midx repack -ad --quiet --write-midx 2>stderr &&
493 test_must_be_empty stderr
494 '
495
496 test_expect_success 'clean up .tmp-* packs on error' '
497 test_must_fail ok=sigpipe git \
498 -c repack.cruftwindow=bogus \
499 repack -ad --cruft &&
500 find $objdir/pack -name '.tmp-*' >tmpfiles &&
501 test_must_be_empty tmpfiles
502 '
503
504 test_expect_success 'repack -ad cleans up old .tmp-* packs' '
505 git rev-parse HEAD >input &&
506 git pack-objects $objdir/pack/.tmp-1234 <input &&
507 git repack -ad &&
508 find $objdir/pack -name '.tmp-*' >tmpfiles &&
509 test_must_be_empty tmpfiles
510 '
511
512 test_expect_success 'setup for update-server-info' '
513 git init update-server-info &&
514 test_commit -C update-server-info message
515 '
516
517 test_server_info_present () {
518 test_path_is_file update-server-info/.git/objects/info/packs &&
519 test_path_is_file update-server-info/.git/info/refs
520 }
521
522 test_server_info_missing () {
523 test_path_is_missing update-server-info/.git/objects/info/packs &&
524 test_path_is_missing update-server-info/.git/info/refs
525 }
526
527 test_server_info_cleanup () {
528 rm -f update-server-info/.git/objects/info/packs update-server-info/.git/info/refs &&
529 test_server_info_missing
530 }
531
532 test_expect_success 'updates server info by default' '
533 test_server_info_cleanup &&
534 git -C update-server-info repack &&
535 test_server_info_present
536 '
537
538 test_expect_success '-n skips updating server info' '
539 test_server_info_cleanup &&
540 git -C update-server-info repack -n &&
541 test_server_info_missing
542 '
543
544 test_expect_success 'repack.updateServerInfo=true updates server info' '
545 test_server_info_cleanup &&
546 git -C update-server-info -c repack.updateServerInfo=true repack &&
547 test_server_info_present
548 '
549
550 test_expect_success 'repack.updateServerInfo=false skips updating server info' '
551 test_server_info_cleanup &&
552 git -C update-server-info -c repack.updateServerInfo=false repack &&
553 test_server_info_missing
554 '
555
556 test_expect_success '-n overrides repack.updateServerInfo=true' '
557 test_server_info_cleanup &&
558 git -C update-server-info -c repack.updateServerInfo=true repack -n &&
559 test_server_info_missing
560 '
561
562 test_expect_success '--expire-to stores pruned objects (now)' '
563 git init expire-to-now &&
564 (
565 cd expire-to-now &&
566
567 git branch -M main &&
568
569 test_commit base &&
570
571 git checkout -b cruft &&
572 test_commit --no-tag cruft &&
573
574 git rev-list --objects --no-object-names main..cruft >moved.raw &&
575 sort moved.raw >moved.want &&
576
577 git rev-list --all --objects --no-object-names >expect.raw &&
578 sort expect.raw >expect &&
579
580 git checkout main &&
581 git branch -D cruft &&
582 git reflog expire --all --expire=all &&
583
584 git init --bare expired.git &&
585 git repack -d \
586 --cruft --cruft-expiration="now" \
587 --expire-to="expired.git/objects/pack/pack" &&
588
589 expired="$(ls expired.git/objects/pack/pack-*.idx)" &&
590 test_path_is_file "${expired%.idx}.mtimes" &&
591
592 # Since the `--cruft-expiration` is "now", the effective
593 # behavior is to move _all_ unreachable objects out to
594 # the location in `--expire-to`.
595 git show-index <$expired >expired.raw &&
596 cut -d" " -f2 expired.raw | sort >expired.objects &&
597 git rev-list --all --objects --no-object-names \
598 >remaining.objects &&
599
600 # ...in other words, the combined contents of this
601 # repository and expired.git should be the same as the
602 # set of objects we started with.
603 cat expired.objects remaining.objects | sort >actual &&
604 test_cmp expect actual &&
605
606 # The "moved" objects (i.e., those in expired.git)
607 # should be the same as the cruft objects which were
608 # expired in the previous step.
609 test_cmp moved.want expired.objects
610 )
611 '
612
613 test_expect_success '--expire-to stores pruned objects (5.minutes.ago)' '
614 git init expire-to-5.minutes.ago &&
615 (
616 cd expire-to-5.minutes.ago &&
617
618 git branch -M main &&
619
620 test_commit base &&
621
622 # Create two classes of unreachable objects, one which
623 # is older than 5 minutes (stale), and another which is
624 # newer (recent).
625 for kind in stale recent
626 do
627 git checkout -b $kind main &&
628 test_commit --no-tag $kind || return 1
629 done &&
630
631 git rev-list --objects --no-object-names main..stale >in &&
632 stale="$(git pack-objects $objdir/pack/pack <in)" &&
633 mtime="$(test-tool chmtime --get =-600 $objdir/pack/pack-$stale.pack)" &&
634
635 # expect holds the set of objects we expect to find in
636 # this repository after repacking
637 git rev-list --objects --no-object-names recent >expect.raw &&
638 sort expect.raw >expect &&
639
640 # moved.want holds the set of objects we expect to find
641 # in expired.git
642 git rev-list --objects --no-object-names main..stale >out &&
643 sort out >moved.want &&
644
645 git checkout main &&
646 git branch -D stale recent &&
647 git reflog expire --all --expire=all &&
648 git prune-packed &&
649
650 git init --bare expired.git &&
651 git repack -d \
652 --cruft --cruft-expiration=5.minutes.ago \
653 --expire-to="expired.git/objects/pack/pack" &&
654
655 # Some of the remaining objects in this repository are
656 # unreachable, so use `cat-file --batch-all-objects`
657 # instead of `rev-list` to get their names
658 git cat-file --batch-all-objects --batch-check="%(objectname)" \
659 >remaining.objects &&
660 sort remaining.objects >actual &&
661 test_cmp expect actual &&
662
663 (
664 cd expired.git &&
665
666 expired="$(ls objects/pack/pack-*.mtimes)" &&
667 test-tool pack-mtimes $(basename $expired) >out &&
668 cut -d" " -f1 out | sort >../moved.got &&
669
670 # Ensure that there are as many objects with the
671 # expected mtime as were moved to expired.git.
672 #
673 # In other words, ensure that the recorded
674 # mtimes of any moved objects was written
675 # correctly.
676 grep " $mtime$" out >matching &&
677 test_line_count = $(wc -l <../moved.want) matching
678 ) &&
679 test_cmp moved.want moved.got
680 )
681 '
682
683 test_done