3 # Copyright (c) 2007 Shawn Pearce
6 test_description
='test git fast-import utility'
8 .
"$TEST_DIRECTORY"/diff-lib.sh
;# test-lib chdir's into trash
10 # Print $1 bytes from stdin to stdout.
12 # This could be written as "head -c $1", but IRIX "head" does not
13 # support the -c option.
19 my $nread = sysread(STDIN, $s, $len);
20 die "cannot read: $!" unless defined($nread);
28 for p
in .git
/objects
/pack
/*.pack
30 git verify-pack
"$@" "$p" ||
return
44 file5_data
='an inline file.
45 we should see it later.'
54 test_expect_success
'empty stream succeeds' '
55 git fast-import </dev/null
58 test_expect_success
'A: create pack from stdin' '
60 cat >input <<-INPUT_END &&
77 commit refs/heads/master
79 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
91 An annotated tag without a tagger
97 An annotated tag that annotates a blob.
101 git fast-import --export-marks=marks.out <input &&
102 git whatchanged master
105 test_expect_success
'A: verify pack' '
109 test_expect_success
'A: verify commit' '
110 cat >expect <<-EOF &&
111 author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
112 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
116 git cat-file commit master | sed 1d >actual &&
117 test_cmp expect actual
120 test_expect_success
'A: verify tree' '
121 cat >expect <<-\EOF &&
126 git cat-file -p master^{tree} | sed "s/ [0-9a-f]* / /" >actual &&
127 test_cmp expect actual
130 test_expect_success
'A: verify file2' '
131 echo "$file2_data" >expect &&
132 git cat-file blob master:file2 >actual &&
133 test_cmp expect actual
136 test_expect_success
'A: verify file3' '
137 echo "$file3_data" >expect &&
138 git cat-file blob master:file3 >actual &&
139 test_cmp expect actual
142 test_expect_success
'A: verify file4' '
143 printf "$file4_data" >expect &&
144 git cat-file blob master:file4 >actual &&
145 test_cmp expect actual
148 test_expect_success
'A: verify tag/series-A' '
149 cat >expect <<-EOF &&
150 object $(git rev-parse refs/heads/master)
154 An annotated tag without a tagger
156 git cat-file tag tags/series-A >actual &&
157 test_cmp expect actual
160 test_expect_success
'A: verify tag/series-A-blob' '
161 cat >expect <<-EOF &&
162 object $(git rev-parse refs/heads/master:file3)
166 An annotated tag that annotates a blob.
168 git cat-file tag tags/series-A-blob >actual &&
169 test_cmp expect actual
172 test_expect_success
'A: verify marks output' '
173 cat >expect <<-EOF &&
174 :2 `git rev-parse --verify master:file2`
175 :3 `git rev-parse --verify master:file3`
176 :4 `git rev-parse --verify master:file4`
177 :5 `git rev-parse --verify master^0`
179 test_cmp expect marks.out
182 test_expect_success
'A: verify marks import' '
184 --import-marks=marks.out \
185 --export-marks=marks.new \
187 test_cmp expect marks.new
190 test_expect_success
'A: tag blob by sha1' '
192 new_blob=$(echo testing | git hash-object --stdin) &&
193 cat >input <<-INPUT_END &&
195 from $(git rev-parse refs/heads/master:file3)
206 commit refs/heads/new_blob
210 #pretend we got sha1 from fast-import
220 cat >expect <<-EOF &&
221 object $(git rev-parse refs/heads/master:file3)
233 git fast-import <input &&
234 git cat-file tag tags/series-A-blob-2 >actual &&
235 git cat-file tag tags/series-A-blob-3 >>actual &&
236 test_cmp expect actual
239 test_expect_success
'A: verify marks import does not crash' '
241 cat >input <<-INPUT_END &&
242 commit refs/heads/verify--import-marks
243 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
249 M 755 :2 copy-of-file2
253 git fast-import --import-marks=marks.out <input &&
254 git whatchanged verify--import-marks
257 test_expect_success
'A: verify pack' '
261 test_expect_success
'A: verify diff' '
262 cat >expect <<-\EOF &&
263 :000000 100755 0000000000000000000000000000000000000000 7123f7f44e39be127c5eb701e5968176ee9d78b1 A copy-of-file2
265 git diff-tree -M -r master verify--import-marks >actual &&
266 compare_diff_raw expect actual &&
267 test `git rev-parse --verify master:file2` \
268 = `git rev-parse --verify verify--import-marks:copy-of-file2`
271 test_expect_success
'A: export marks with large values' '
273 mt=$(git hash-object --stdin < /dev/null) &&
278 cat >input.commit <<-EOF &&
279 commit refs/heads/verify--dump-marks
280 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
282 test the sparse array dumping routines with exponentially growing marks
287 while test "$i" -lt 27
289 cat >>input.blob <<-EOF &&
300 echo "M 100644 :$l l$i" >>input.commit &&
301 echo "M 100644 :$m m$i" >>input.commit &&
302 echo "M 100644 :$n n$i" >>input.commit &&
304 echo ":$l $mt" >>marks.exp &&
305 echo ":$m $mt" >>marks.exp &&
306 echo ":$n $mt" >>marks.exp &&
308 printf "100644 blob $mt\tl$i\n" >>tree.exp &&
309 printf "100644 blob $mt\tm$i\n" >>tree.exp &&
310 printf "100644 blob $mt\tn$i\n" >>tree.exp &&
316 i=$((1 + $i)) || return 1
319 sort tree.exp > tree.exp_s &&
321 cat input.blob input.commit | git fast-import --export-marks=marks.large &&
322 git ls-tree refs/heads/verify--dump-marks >tree.out &&
323 test_cmp tree.exp_s tree.out &&
324 test_cmp marks.exp marks.large
331 test_expect_success
'B: fail on invalid blob sha1' '
333 cat >input <<-INPUT_END &&
334 commit refs/heads/branch
336 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
341 from refs/heads/master
342 M 755 0000000000000000000000000000000000000001 zero1
346 test_when_finished "rm -f .git/objects/pack_* .git/objects/index_*" &&
347 test_must_fail git fast-import <input
350 test_expect_success
'B: accept branch name "TEMP_TAG"' '
351 cat >input <<-INPUT_END &&
353 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
358 from refs/heads/master
362 test_when_finished "rm -f .git/TEMP_TAG
365 git fast-import <input &&
366 test -f .git/TEMP_TAG &&
367 test `git rev-parse master` = `git rev-parse TEMP_TAG^`
370 test_expect_success
'B: accept empty committer' '
371 cat >input <<-INPUT_END &&
372 commit refs/heads/empty-committer-1
373 committer <> $GIT_COMMITTER_DATE
379 test_when_finished "git update-ref -d refs/heads/empty-committer-1
382 git fast-import <input &&
388 test_expect_success
'B: accept and fixup committer with no name' '
389 cat >input <<-INPUT_END &&
390 commit refs/heads/empty-committer-2
391 committer <a@b.com> $GIT_COMMITTER_DATE
397 test_when_finished "git update-ref -d refs/heads/empty-committer-2
400 git fast-import <input &&
406 test_expect_success
'B: fail on invalid committer (1)' '
407 cat >input <<-INPUT_END &&
408 commit refs/heads/invalid-committer
409 committer Name email> $GIT_COMMITTER_DATE
415 test_when_finished "git update-ref -d refs/heads/invalid-committer" &&
416 test_must_fail git fast-import <input
419 test_expect_success
'B: fail on invalid committer (2)' '
420 cat >input <<-INPUT_END &&
421 commit refs/heads/invalid-committer
422 committer Name <e<mail> $GIT_COMMITTER_DATE
428 test_when_finished "git update-ref -d refs/heads/invalid-committer" &&
429 test_must_fail git fast-import <input
432 test_expect_success
'B: fail on invalid committer (3)' '
433 cat >input <<-INPUT_END &&
434 commit refs/heads/invalid-committer
435 committer Name <email>> $GIT_COMMITTER_DATE
441 test_when_finished "git update-ref -d refs/heads/invalid-committer" &&
442 test_must_fail git fast-import <input
445 test_expect_success
'B: fail on invalid committer (4)' '
446 cat >input <<-INPUT_END &&
447 commit refs/heads/invalid-committer
448 committer Name <email $GIT_COMMITTER_DATE
454 test_when_finished "git update-ref -d refs/heads/invalid-committer" &&
455 test_must_fail git fast-import <input
458 test_expect_success
'B: fail on invalid committer (5)' '
459 cat >input <<-INPUT_END &&
460 commit refs/heads/invalid-committer
461 committer Name<email> $GIT_COMMITTER_DATE
467 test_when_finished "git update-ref -d refs/heads/invalid-committer" &&
468 test_must_fail git fast-import <input
475 test_expect_success
'C: incremental import create pack from stdin' '
476 newf=`echo hi newf | git hash-object -w --stdin` &&
477 oldf=`git rev-parse --verify master:file2` &&
479 cat >input <<-INPUT_END &&
480 commit refs/heads/branch
481 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
486 from refs/heads/master
487 M 644 $oldf file2/oldf
488 M 755 $newf file2/newf
493 git fast-import <input &&
494 git whatchanged branch
497 test_expect_success
'C: verify pack' '
501 test_expect_success
'C: validate reuse existing blob' '
502 test $newf = `git rev-parse --verify branch:file2/newf` &&
503 test $oldf = `git rev-parse --verify branch:file2/oldf`
506 test_expect_success
'C: verify commit' '
507 cat >expect <<-EOF &&
508 parent `git rev-parse --verify master^0`
509 author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
510 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
515 git cat-file commit branch | sed 1d >actual &&
516 test_cmp expect actual
519 test_expect_success
'C: validate rename result' '
520 cat >expect <<-\EOF &&
521 :000000 100755 0000000000000000000000000000000000000000 f1fb5da718392694d0076d677d6d0e364c79b0bc A file2/newf
522 :100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 R100 file2 file2/oldf
523 :100644 000000 0d92e9f3374ae2947c23aa477cbc68ce598135f1 0000000000000000000000000000000000000000 D file3
525 git diff-tree -M -r master branch >actual &&
526 compare_diff_raw expect actual
533 test_expect_success
'D: inline data in commit' '
535 cat >input <<-INPUT_END &&
536 commit refs/heads/branch
537 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
542 from refs/heads/branch^0
543 M 644 inline newdir/interesting
548 M 755 inline newdir/exec.sh
555 git fast-import <input &&
556 git whatchanged branch
559 test_expect_success
'D: verify pack' '
563 test_expect_success
'D: validate new files added' '
564 cat >expect <<-\EOF &&
565 :000000 100755 0000000000000000000000000000000000000000 e74b7d465e52746be2b4bae983670711e6e66657 A newdir/exec.sh
566 :000000 100644 0000000000000000000000000000000000000000 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 A newdir/interesting
568 git diff-tree -M -r branch^ branch >actual &&
569 compare_diff_raw expect actual
572 test_expect_success
'D: verify file5' '
573 echo "$file5_data" >expect &&
574 git cat-file blob branch:newdir/interesting >actual &&
575 test_cmp expect actual
578 test_expect_success
'D: verify file6' '
579 echo "$file6_data" >expect &&
580 git cat-file blob branch:newdir/exec.sh >actual &&
581 test_cmp expect actual
588 test_expect_success
'E: rfc2822 date, --date-format=raw' '
589 cat >input <<-INPUT_END &&
590 commit refs/heads/branch
591 author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> Tue Feb 6 11:22:18 2007 -0500
592 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> Tue Feb 6 12:35:02 2007 -0500
597 from refs/heads/branch^0
601 test_must_fail git fast-import --date-format=raw <input
603 test_expect_success
'E: rfc2822 date, --date-format=rfc2822' '
604 git fast-import --date-format=rfc2822 <input
607 test_expect_success
'E: verify pack' '
611 test_expect_success
'E: verify commit' '
612 cat >expect <<-EOF &&
613 author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> 1170778938 -0500
614 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1170783302 -0500
618 git cat-file commit branch | sed 1,2d >actual &&
619 test_cmp expect actual
626 test_expect_success
'F: non-fast-forward update skips' '
627 old_branch=`git rev-parse --verify branch^0` &&
629 cat >input <<-INPUT_END &&
630 commit refs/heads/branch
631 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
633 losing things already?
636 from refs/heads/branch~1
638 reset refs/heads/other
639 from refs/heads/branch
643 test_must_fail git fast-import <input &&
644 # branch must remain unaffected
645 test $old_branch = `git rev-parse --verify branch^0`
648 test_expect_success
'F: verify pack' '
652 test_expect_success
'F: verify other commit' '
653 cat >expect <<-EOF &&
654 tree `git rev-parse branch~1^{tree}`
655 parent `git rev-parse branch~1`
656 author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
657 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
659 losing things already?
661 git cat-file commit other >actual &&
662 test_cmp expect actual
669 old_branch
=`git rev-parse --verify branch^0`
671 cat >input
<<INPUT_END
672 commit refs/heads/branch
673 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
675 losing things already?
678 from refs/heads/branch~1
681 test_expect_success
'G: non-fast-forward update forced' '
682 git fast-import --force <input
685 test_expect_success
'G: verify pack' '
689 test_expect_success
'G: branch changed, but logged' '
690 test $old_branch != `git rev-parse --verify branch^0` &&
691 test $old_branch = `git rev-parse --verify branch@{1}`
699 cat >input
<<INPUT_END
701 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
706 from refs/heads/branch^0
707 M 644 inline i-will-die
709 this file will never exist.
713 M 644 inline h/e/l/lo
719 test_expect_success
'H: deletall, add 1' '
720 git fast-import <input &&
724 test_expect_success
'H: verify pack' '
729 :100755 000000 f1fb5da718392694d0076d677d6d0e364c79b0bc 0000000000000000000000000000000000000000 D file2/newf
730 :100644 000000 7123f7f44e39be127c5eb701e5968176ee9d78b1 0000000000000000000000000000000000000000 D file2/oldf
731 :100755 000000 85df50785d62d3b05ab03d9cbf7e4a0b49449730 0000000000000000000000000000000000000000 D file4
732 :100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 R100 newdir/interesting h/e/l/lo
733 :100755 000000 e74b7d465e52746be2b4bae983670711e6e66657 0000000000000000000000000000000000000000 D newdir/exec.sh
735 git diff-tree
-M -r H^ H
>actual
736 test_expect_success
'H: validate old files removed, new files added' '
737 compare_diff_raw expect actual
740 echo "$file5_data" >expect
741 test_expect_success
'H: verify file' '
742 git cat-file blob H:h/e/l/lo >actual &&
743 test_cmp expect actual
750 cat >input
<<INPUT_END
751 commit refs/heads/export-boundary
752 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
754 we have a border. its only 40 characters wide.
757 from refs/heads/branch
760 test_expect_success
'I: export-pack-edges' '
761 git fast-import --export-pack-edges=edges.list <input
765 .git/objects/pack/pack-.pack: `git rev-parse --verify export-boundary`
767 test_expect_success
'I: verify edge list' '
768 sed -e s/pack-.*pack/pack-.pack/ edges.list >actual &&
769 test_cmp expect actual
776 cat >input
<<INPUT_END
778 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
783 from refs/heads/branch
788 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
794 test_expect_success
'J: reset existing branch creates empty commit' '
795 git fast-import <input
797 test_expect_success
'J: branch has 1 commit, empty tree' '
798 test 1 = `git rev-list J | wc -l` &&
799 test 0 = `git ls-tree J | wc -l`
802 cat >input
<<INPUT_END
808 Tag branch that was reset.
811 test_expect_success
'J: tag must fail on empty branch' '
812 test_must_fail git fast-import <input
818 cat >input
<<INPUT_END
820 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
825 from refs/heads/branch
828 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
833 from refs/heads/branch^1
836 test_expect_success
'K: reinit branch with from' '
837 git fast-import <input
839 test_expect_success
'K: verify K^1 = branch^1' '
840 test `git rev-parse --verify branch^1` \
841 = `git rev-parse --verify K^1`
848 cat >input
<<INPUT_END
862 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
872 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
882 cat >expect
<<EXPECT_END
883 :100644 100644 4268632... 55d3a52... M b.
884 :040000 040000 0ae5cac... 443c768... M b
885 :100644 100644 4268632... 55d3a52... M ba
888 test_expect_success
'L: verify internal tree sorting' '
889 git fast-import <input &&
890 git diff-tree --abbrev --raw L^ L >output &&
891 test_cmp expect output
894 cat >input
<<INPUT_END
902 committer C O Mitter <committer@example.com> 1112912473 -0700
911 committer C O Mitter <committer@example.com> 1112912473 -0700
925 test_expect_success
'L: nested tree copy does not corrupt deltas' '
926 test_when_finished "git update-ref -d refs/heads/L2" &&
927 git fast-import <input &&
928 git ls-tree L2 g/b/ >tmp &&
929 cat tmp | cut -f 2 >actual &&
930 test_cmp expect actual &&
931 git fsck `git rev-parse L2`
939 cat >input
<<INPUT_END
941 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
946 from refs/heads/branch^0
947 R file2/newf file2/n.e.w.f
952 :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc R100 file2/newf file2/n.e.w.f
954 test_expect_success
'M: rename file in same subdirectory' '
955 git fast-import <input &&
956 git diff-tree -M -r M1^ M1 >actual &&
957 compare_diff_raw expect actual
960 cat >input
<<INPUT_END
962 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
967 from refs/heads/branch^0
968 R file2/newf i/am/new/to/you
973 :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc R100 file2/newf i/am/new/to/you
975 test_expect_success
'M: rename file to new subdirectory' '
976 git fast-import <input &&
977 git diff-tree -M -r M2^ M2 >actual &&
978 compare_diff_raw expect actual
981 cat >input
<<INPUT_END
983 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
994 :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc R100 i/am/new/to/you other/sub/am/new/to/you
996 test_expect_success
'M: rename subdirectory to new subdirectory' '
997 git fast-import <input &&
998 git diff-tree -M -r M3^ M3 >actual &&
999 compare_diff_raw expect actual
1002 cat >input
<<INPUT_END
1003 commit refs/heads/M4
1004 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1009 from refs/heads/M2^0
1015 :100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 R100 file2/oldf sub/file2/oldf
1016 :100755 100755 85df50785d62d3b05ab03d9cbf7e4a0b49449730 85df50785d62d3b05ab03d9cbf7e4a0b49449730 R100 file4 sub/file4
1017 :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc R100 i/am/new/to/you sub/i/am/new/to/you
1018 :100755 100755 e74b7d465e52746be2b4bae983670711e6e66657 e74b7d465e52746be2b4bae983670711e6e66657 R100 newdir/exec.sh sub/newdir/exec.sh
1019 :100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 R100 newdir/interesting sub/newdir/interesting
1021 test_expect_success
'M: rename root to subdirectory' '
1022 git fast-import <input &&
1023 git diff-tree -M -r M4^ M4 >actual &&
1025 compare_diff_raw expect actual
1033 cat >input
<<INPUT_END
1034 commit refs/heads/N1
1035 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1040 from refs/heads/branch^0
1041 C file2/newf file2/n.e.w.f
1046 :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100 file2/newf file2/n.e.w.f
1048 test_expect_success
'N: copy file in same subdirectory' '
1049 git fast-import <input &&
1050 git diff-tree -C --find-copies-harder -r N1^ N1 >actual &&
1051 compare_diff_raw expect actual
1054 cat >input
<<INPUT_END
1055 commit refs/heads/N2
1056 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1058 clean directory copy
1061 from refs/heads/branch^0
1064 commit refs/heads/N2
1065 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1067 modify directory copy
1070 M 644 inline file3/file5
1078 :100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 C100 newdir/interesting file3/file5
1079 :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100 file2/newf file3/newf
1080 :100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100 file2/oldf file3/oldf
1082 test_expect_success
'N: copy then modify subdirectory' '
1083 git fast-import <input &&
1084 git diff-tree -C --find-copies-harder -r N2^^ N2 >actual &&
1085 compare_diff_raw expect actual
1088 cat >input
<<INPUT_END
1089 commit refs/heads/N3
1090 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1092 dirty directory copy
1095 from refs/heads/branch^0
1096 M 644 inline file2/file5
1106 test_expect_success
'N: copy dirty subdirectory' '
1107 git fast-import <input &&
1108 test `git rev-parse N2^{tree}` = `git rev-parse N3^{tree}`
1111 test_expect_success
'N: copy directory by id' '
1112 cat >expect <<-\EOF &&
1113 :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100 file2/newf file3/newf
1114 :100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100 file2/oldf file3/oldf
1116 subdir=$(git rev-parse refs/heads/branch^0:file2) &&
1117 cat >input <<-INPUT_END &&
1118 commit refs/heads/N4
1119 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1124 from refs/heads/branch^0
1125 M 040000 $subdir file3
1127 git fast-import <input &&
1128 git diff-tree -C --find-copies-harder -r N4^ N4 >actual &&
1129 compare_diff_raw expect actual
1132 test_expect_success PIPE
'N: read and copy directory' '
1133 cat >expect <<-\EOF &&
1134 :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100 file2/newf file3/newf
1135 :100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100 file2/oldf file3/oldf
1137 git update-ref -d refs/heads/N4 &&
1143 commit refs/heads/N4
1144 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1146 copy by tree hash, part 2
1149 from refs/heads/branch^0
1152 read mode type tree filename &&
1153 echo "M 040000 $tree file3"
1155 git fast-import --cat-blob-fd=3 3>backflow &&
1156 git diff-tree -C --find-copies-harder -r N4^ N4 >actual &&
1157 compare_diff_raw expect actual
1160 test_expect_success PIPE
'N: empty directory reads as missing' '
1161 cat <<-\EOF >expect &&
1163 :000000 100644 OBJNAME OBJNAME A unrelated
1165 echo "missing src" >expect.response &&
1166 git update-ref -d refs/heads/read-empty &&
1172 commit refs/heads/read-empty
1173 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1175 read "empty" (missing) directory
1178 M 100644 inline src/greeting
1182 C src/greeting dst1/non-greeting
1183 C src/greeting unrelated
1184 # leave behind "empty" src directory
1189 printf "%s\n" "$line" >response &&
1195 git fast-import --cat-blob-fd=3 3>backflow &&
1196 test_cmp expect.response response &&
1197 git rev-list read-empty |
1198 git diff-tree -r --root --stdin |
1199 sed "s/$_x40/OBJNAME/g" >actual &&
1200 test_cmp expect actual
1203 test_expect_success
'N: copy root directory by tree hash' '
1204 cat >expect <<-\EOF &&
1205 :100755 000000 f1fb5da718392694d0076d677d6d0e364c79b0bc 0000000000000000000000000000000000000000 D file3/newf
1206 :100644 000000 7123f7f44e39be127c5eb701e5968176ee9d78b1 0000000000000000000000000000000000000000 D file3/oldf
1208 root=$(git rev-parse refs/heads/branch^0^{tree}) &&
1209 cat >input <<-INPUT_END &&
1210 commit refs/heads/N6
1211 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1213 copy root directory by tree hash
1216 from refs/heads/branch^0
1219 git fast-import <input &&
1220 git diff-tree -C --find-copies-harder -r N4 N6 >actual &&
1221 compare_diff_raw expect actual
1224 test_expect_success
'N: copy root by path' '
1225 cat >expect <<-\EOF &&
1226 :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100 file2/newf oldroot/file2/newf
1227 :100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100 file2/oldf oldroot/file2/oldf
1228 :100755 100755 85df50785d62d3b05ab03d9cbf7e4a0b49449730 85df50785d62d3b05ab03d9cbf7e4a0b49449730 C100 file4 oldroot/file4
1229 :100755 100755 e74b7d465e52746be2b4bae983670711e6e66657 e74b7d465e52746be2b4bae983670711e6e66657 C100 newdir/exec.sh oldroot/newdir/exec.sh
1230 :100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 C100 newdir/interesting oldroot/newdir/interesting
1232 cat >input <<-INPUT_END &&
1233 commit refs/heads/N-copy-root-path
1234 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1236 copy root directory by (empty) path
1239 from refs/heads/branch^0
1242 git fast-import <input &&
1243 git diff-tree -C --find-copies-harder -r branch N-copy-root-path >actual &&
1244 compare_diff_raw expect actual
1247 test_expect_success
'N: delete directory by copying' '
1248 cat >expect <<-\EOF &&
1250 :100644 000000 OBJID OBJID D foo/bar/qux
1252 :000000 100644 OBJID OBJID A foo/bar/baz
1253 :000000 100644 OBJID OBJID A foo/bar/qux
1255 empty_tree=$(git mktree </dev/null) &&
1256 cat >input <<-INPUT_END &&
1257 commit refs/heads/N-delete
1258 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1260 collect data to be deleted
1264 M 100644 inline foo/bar/baz
1268 C "foo/bar/baz" "foo/bar/qux"
1269 C "foo/bar/baz" "foo/bar/quux/1"
1270 C "foo/bar/baz" "foo/bar/quuux"
1271 M 040000 $empty_tree foo/bar/quux
1272 M 040000 $empty_tree foo/bar/quuux
1274 commit refs/heads/N-delete
1275 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1280 M 040000 $empty_tree foo/bar/qux
1282 git fast-import <input &&
1283 git rev-list N-delete |
1284 git diff-tree -r --stdin --root --always |
1285 sed -e "s/$_x40/OBJID/g" >actual &&
1286 test_cmp expect actual
1289 test_expect_success
'N: modify copied tree' '
1290 cat >expect <<-\EOF &&
1291 :100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 C100 newdir/interesting file3/file5
1292 :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100 file2/newf file3/newf
1293 :100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100 file2/oldf file3/oldf
1295 subdir=$(git rev-parse refs/heads/branch^0:file2) &&
1296 cat >input <<-INPUT_END &&
1297 commit refs/heads/N5
1298 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1303 from refs/heads/branch^0
1304 M 040000 $subdir file3
1306 commit refs/heads/N5
1307 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1309 modify directory copy
1312 M 644 inline file3/file5
1317 git fast-import <input &&
1318 git diff-tree -C --find-copies-harder -r N5^^ N5 >actual &&
1319 compare_diff_raw expect actual
1322 test_expect_success
'N: reject foo/ syntax' '
1323 subdir=$(git rev-parse refs/heads/branch^0:file2) &&
1324 test_must_fail git fast-import <<-INPUT_END
1325 commit refs/heads/N5B
1326 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1328 copy with invalid syntax
1331 from refs/heads/branch^0
1332 M 040000 $subdir file3/
1336 test_expect_success
'N: reject foo/ syntax in copy source' '
1337 test_must_fail git fast-import <<-INPUT_END
1338 commit refs/heads/N5C
1339 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1341 copy with invalid syntax
1344 from refs/heads/branch^0
1349 test_expect_success
'N: reject foo/ syntax in rename source' '
1350 test_must_fail git fast-import <<-INPUT_END
1351 commit refs/heads/N5D
1352 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1354 rename with invalid syntax
1357 from refs/heads/branch^0
1362 test_expect_success
'N: reject foo/ syntax in ls argument' '
1363 test_must_fail git fast-import <<-INPUT_END
1364 commit refs/heads/N5E
1365 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1367 copy with invalid syntax
1370 from refs/heads/branch^0
1375 test_expect_success
'N: copy to root by id and modify' '
1376 echo "hello, world" >expect.foo &&
1377 echo hello >expect.bar &&
1378 git fast-import <<-SETUP_END &&
1379 commit refs/heads/N7
1380 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1386 M 644 inline foo/bar
1392 tree=$(git rev-parse --verify N7:) &&
1393 git fast-import <<-INPUT_END &&
1394 commit refs/heads/N8
1395 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1397 copy to root by id and modify
1401 M 644 inline foo/foo
1406 git show N8:foo/foo >actual.foo &&
1407 git show N8:foo/bar >actual.bar &&
1408 test_cmp expect.foo actual.foo &&
1409 test_cmp expect.bar actual.bar
1412 test_expect_success
'N: extract subtree' '
1413 branch=$(git rev-parse --verify refs/heads/branch^{tree}) &&
1414 cat >input <<-INPUT_END &&
1415 commit refs/heads/N9
1416 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1418 extract subtree branch:newdir
1424 git fast-import <input &&
1425 git diff --exit-code branch:newdir N9
1428 test_expect_success
'N: modify subtree, extract it, and modify again' '
1429 echo hello >expect.baz &&
1430 echo hello, world >expect.qux &&
1431 git fast-import <<-SETUP_END &&
1432 commit refs/heads/N10
1433 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1439 M 644 inline foo/bar/baz
1445 tree=$(git rev-parse --verify N10:) &&
1446 git fast-import <<-INPUT_END &&
1447 commit refs/heads/N11
1448 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1450 copy to root by id and modify
1454 M 100644 inline foo/bar/qux
1459 C "bar/qux" "bar/quux"
1461 git show N11:bar/baz >actual.baz &&
1462 git show N11:bar/qux >actual.qux &&
1463 git show N11:bar/quux >actual.quux &&
1464 test_cmp expect.baz actual.baz &&
1465 test_cmp expect.qux actual.qux &&
1466 test_cmp expect.qux actual.quux'
1472 cat >input
<<INPUT_END
1474 commit refs/heads/O1
1475 # -- ignore all of this text
1476 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1477 # $GIT_COMMITTER_NAME has inserted here for his benefit.
1479 dirty directory copy
1482 # don't forget the import blank line!
1484 # yes, we started from our usual base of branch^0.
1486 from refs/heads/branch^0
1487 # and we need to reuse file2/file5 from N3 above.
1488 M 644 inline file2/file5
1489 # otherwise the tree will be different
1494 # don't forget to copy file2 to file3
1497 # or to delete file5 from file2.
1503 test_expect_success
'O: comments are all skipped' '
1504 git fast-import <input &&
1505 test `git rev-parse N3` = `git rev-parse O1`
1508 cat >input
<<INPUT_END
1509 commit refs/heads/O2
1510 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1512 dirty directory copy
1514 from refs/heads/branch^0
1515 M 644 inline file2/file5
1524 test_expect_success
'O: blank lines not necessary after data commands' '
1525 git fast-import <input &&
1526 test `git rev-parse N3` = `git rev-parse O2`
1529 test_expect_success
'O: repack before next test' '
1533 cat >input
<<INPUT_END
1534 commit refs/heads/O3
1535 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1539 commit refs/heads/O3
1540 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1545 commit refs/heads/O3
1547 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1552 commit refs/heads/O3
1553 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1557 reset refs/tags/O3-2nd
1559 reset refs/tags/O3-3rd
1563 cat >expect
<<INPUT_END
1569 test_expect_success
'O: blank lines not necessary after other commands' '
1570 git fast-import <input &&
1571 test 8 = `find .git/objects/pack -type f | wc -l` &&
1572 test `git rev-parse refs/tags/O3-2nd` = `git rev-parse O3^` &&
1573 git log --reverse --pretty=oneline O3 | sed s/^.*z// >actual &&
1574 test_cmp expect actual
1577 cat >input
<<INPUT_END
1578 commit refs/heads/O4
1579 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1583 commit refs/heads/O4
1584 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1588 progress Two commits down, 2 to go!
1589 commit refs/heads/O4
1590 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1594 progress Three commits down, 1 to go!
1595 commit refs/heads/O4
1596 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1602 test_expect_success
'O: progress outputs as requested by input' '
1603 git fast-import <input >actual &&
1604 grep "progress " <input >expect &&
1605 test_cmp expect actual
1609 ### series P (gitlinks)
1612 cat >input
<<INPUT_END
1618 reset refs/heads/sub
1619 commit refs/heads/sub
1621 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1634 commit refs/heads/subuse1
1636 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1639 from refs/heads/master
1640 M 100644 :3 .gitmodules
1649 commit refs/heads/sub
1651 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1657 commit refs/heads/subuse1
1659 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1667 test_expect_success
'P: superproject & submodule mix' '
1668 git fast-import <input &&
1669 git checkout subuse1 &&
1675 git fetch --update-head-ok .. refs/heads/sub:refs/heads/master &&
1678 git submodule init &&
1679 git submodule update
1682 SUBLAST
=$
(git rev-parse
--verify sub
)
1683 SUBPREV
=$
(git rev-parse
--verify sub^
)
1685 cat >input
<<INPUT_END
1694 commit refs/heads/subuse2
1696 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1699 from refs/heads/master
1700 M 100644 :1 .gitmodules
1701 M 160000 $SUBPREV sub
1703 commit refs/heads/subuse2
1705 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1709 M 160000 $SUBLAST sub
1713 test_expect_success
'P: verbatim SHA gitlinks' '
1714 git branch -D sub &&
1717 git fast-import <input &&
1718 test $(git rev-parse --verify subuse2) = $(git rev-parse --verify subuse1)
1722 cat >input
<<INPUT_END
1723 commit refs/heads/subuse3
1725 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1730 from refs/heads/subuse2
1738 test_expect_success
'P: fail on inline gitlink' '
1739 test_must_fail git fast-import <input
1743 cat >input
<<INPUT_END
1750 commit refs/heads/subuse3
1752 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1757 from refs/heads/subuse2
1762 test_expect_success
'P: fail on blob mark in gitlink' '
1763 test_must_fail git fast-import <input
1767 ### series Q (notes)
1770 note1_data
="The first note for the first commit"
1771 note2_data
="The first note for the second commit"
1772 note3_data
="The first note for the third commit"
1773 note1b_data
="The second note for the first commit"
1774 note1c_data
="The third note for the first commit"
1775 note2b_data
="The second note for the second commit"
1778 cat >input
<<INPUT_END
1785 commit refs/heads/notes-test
1787 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1798 commit refs/heads/notes-test
1800 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1807 commit refs/heads/notes-test
1809 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1836 commit refs/notes/foobar
1838 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1850 commit refs/notes/foobar
1852 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1862 commit refs/notes/foobar2
1864 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1874 commit refs/notes/foobar
1876 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1889 test_expect_success
'Q: commit notes' '
1890 git fast-import <input &&
1891 git whatchanged notes-test
1894 test_expect_success
'Q: verify pack' '
1898 commit1
=$
(git rev-parse notes-test~
2)
1899 commit2
=$
(git rev-parse notes-test^
)
1900 commit3
=$
(git rev-parse notes-test
)
1903 author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1904 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1908 test_expect_success
'Q: verify first commit' '
1909 git cat-file commit notes-test~2 | sed 1d >actual &&
1910 test_cmp expect actual
1915 author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1916 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1920 test_expect_success
'Q: verify second commit' '
1921 git cat-file commit notes-test^ | sed 1d >actual &&
1922 test_cmp expect actual
1927 author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1928 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1932 test_expect_success
'Q: verify third commit' '
1933 git cat-file commit notes-test | sed 1d >actual &&
1934 test_cmp expect actual
1938 author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1939 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1943 test_expect_success
'Q: verify first notes commit' '
1944 git cat-file commit refs/notes/foobar~2 | sed 1d >actual &&
1945 test_cmp expect actual
1948 cat >expect.unsorted
<<EOF
1949 100644 blob $commit1
1950 100644 blob $commit2
1951 100644 blob $commit3
1953 cat expect.unsorted |
sort >expect
1954 test_expect_success
'Q: verify first notes tree' '
1955 git cat-file -p refs/notes/foobar~2^{tree} | sed "s/ [0-9a-f]* / /" >actual &&
1956 test_cmp expect actual
1959 echo "$note1_data" >expect
1960 test_expect_success
'Q: verify first note for first commit' '
1961 git cat-file blob refs/notes/foobar~2:$commit1 >actual &&
1962 test_cmp expect actual
1965 echo "$note2_data" >expect
1966 test_expect_success
'Q: verify first note for second commit' '
1967 git cat-file blob refs/notes/foobar~2:$commit2 >actual &&
1968 test_cmp expect actual
1971 echo "$note3_data" >expect
1972 test_expect_success
'Q: verify first note for third commit' '
1973 git cat-file blob refs/notes/foobar~2:$commit3 >actual &&
1974 test_cmp expect actual
1978 parent `git rev-parse --verify refs/notes/foobar~2`
1979 author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1980 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1984 test_expect_success
'Q: verify second notes commit' '
1985 git cat-file commit refs/notes/foobar^ | sed 1d >actual &&
1986 test_cmp expect actual
1989 cat >expect.unsorted
<<EOF
1990 100644 blob $commit1
1991 100644 blob $commit2
1992 100644 blob $commit3
1994 cat expect.unsorted |
sort >expect
1995 test_expect_success
'Q: verify second notes tree' '
1996 git cat-file -p refs/notes/foobar^^{tree} | sed "s/ [0-9a-f]* / /" >actual &&
1997 test_cmp expect actual
2000 echo "$note1b_data" >expect
2001 test_expect_success
'Q: verify second note for first commit' '
2002 git cat-file blob refs/notes/foobar^:$commit1 >actual &&
2003 test_cmp expect actual
2006 echo "$note2_data" >expect
2007 test_expect_success
'Q: verify first note for second commit' '
2008 git cat-file blob refs/notes/foobar^:$commit2 >actual &&
2009 test_cmp expect actual
2012 echo "$note3_data" >expect
2013 test_expect_success
'Q: verify first note for third commit' '
2014 git cat-file blob refs/notes/foobar^:$commit3 >actual &&
2015 test_cmp expect actual
2019 author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2020 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2024 test_expect_success
'Q: verify third notes commit' '
2025 git cat-file commit refs/notes/foobar2 | sed 1d >actual &&
2026 test_cmp expect actual
2029 cat >expect.unsorted
<<EOF
2030 100644 blob $commit1
2032 cat expect.unsorted |
sort >expect
2033 test_expect_success
'Q: verify third notes tree' '
2034 git cat-file -p refs/notes/foobar2^{tree} | sed "s/ [0-9a-f]* / /" >actual &&
2035 test_cmp expect actual
2038 echo "$note1c_data" >expect
2039 test_expect_success
'Q: verify third note for first commit' '
2040 git cat-file blob refs/notes/foobar2:$commit1 >actual &&
2041 test_cmp expect actual
2045 parent `git rev-parse --verify refs/notes/foobar^`
2046 author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2047 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2051 test_expect_success
'Q: verify fourth notes commit' '
2052 git cat-file commit refs/notes/foobar | sed 1d >actual &&
2053 test_cmp expect actual
2056 cat >expect.unsorted
<<EOF
2057 100644 blob $commit2
2059 cat expect.unsorted |
sort >expect
2060 test_expect_success
'Q: verify fourth notes tree' '
2061 git cat-file -p refs/notes/foobar^{tree} | sed "s/ [0-9a-f]* / /" >actual &&
2062 test_cmp expect actual
2065 echo "$note2b_data" >expect
2066 test_expect_success
'Q: verify second note for second commit' '
2067 git cat-file blob refs/notes/foobar:$commit2 >actual &&
2068 test_cmp expect actual
2074 commit refs/heads/note-Q0
2075 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2077 Note for an empty branch.
2080 N inline refs/heads/Q0
2085 test_expect_success
'Q: deny note on empty branch' '
2086 test_must_fail git fast-import <input
2089 ### series R (feature and option)
2093 feature no-such-feature-exists
2096 test_expect_success
'R: abort on unsupported feature' '
2097 test_must_fail git fast-import <input
2101 feature date-format=now
2104 test_expect_success
'R: supported feature is accepted' '
2105 git fast-import <input
2112 feature date-format=now
2115 test_expect_success
'R: abort on receiving feature after data command' '
2116 test_must_fail git fast-import <input
2120 feature import-marks=git.marks
2121 feature import-marks=git2.marks
2124 test_expect_success
'R: only one import-marks feature allowed per stream' '
2125 test_must_fail git fast-import <input
2129 feature export-marks=git.marks
2137 test_expect_success
'R: export-marks feature results in a marks file being created' '
2138 cat input | git fast-import &&
2142 test_expect_success
'R: export-marks options can be overridden by commandline options' '
2143 cat input | git fast-import --export-marks=other.marks &&
2147 test_expect_success
'R: catch typo in marks file name' '
2148 test_must_fail git fast-import --import-marks=nonexistent.marks </dev/null &&
2149 echo "feature import-marks=nonexistent.marks" |
2150 test_must_fail git fast-import
2153 test_expect_success
'R: import and output marks can be the same file' '
2155 blob=$(echo hi | git hash-object --stdin) &&
2156 cat >expect <<-EOF &&
2160 git fast-import --export-marks=io.marks <<-\EOF &&
2167 git fast-import --import-marks=io.marks --export-marks=io.marks <<-\EOF &&
2174 test_cmp expect io.marks
2177 test_expect_success
'R: --import-marks=foo --output-marks=foo to create foo fails' '
2179 test_must_fail git fast-import --import-marks=io.marks --export-marks=io.marks <<-\EOF
2188 test_expect_success
'R: --import-marks-if-exists' '
2190 blob=$(echo hi | git hash-object --stdin) &&
2191 echo ":1 $blob" >expect &&
2192 git fast-import --import-marks-if-exists=io.marks --export-marks=io.marks <<-\EOF &&
2199 test_cmp expect io.marks
2202 test_expect_success
'R: feature import-marks-if-exists' '
2206 git fast-import --export-marks=io.marks <<-\EOF &&
2207 feature import-marks-if-exists=not_io.marks
2209 test_cmp expect io.marks &&
2211 blob=$(echo hi | git hash-object --stdin) &&
2213 echo ":1 $blob" >io.marks &&
2214 echo ":1 $blob" >expect &&
2215 echo ":2 $blob" >>expect &&
2217 git fast-import --export-marks=io.marks <<-\EOF &&
2218 feature import-marks-if-exists=io.marks
2225 test_cmp expect io.marks &&
2227 echo ":3 $blob" >>expect &&
2229 git fast-import --import-marks=io.marks \
2230 --export-marks=io.marks <<-\EOF &&
2231 feature import-marks-if-exists=not_io.marks
2238 test_cmp expect io.marks &&
2242 git fast-import --import-marks-if-exists=not_io.marks \
2243 --export-marks=io.marks <<-\EOF &&
2244 feature import-marks-if-exists=io.marks
2246 test_cmp expect io.marks
2250 feature import-marks=marks.out
2251 feature export-marks=marks.new
2254 test_expect_success
'R: import to output marks works without any content' '
2255 cat input | git fast-import &&
2256 test_cmp marks.out marks.new
2260 feature import-marks=nonexistent.marks
2261 feature export-marks=marks.new
2264 test_expect_success
'R: import marks prefers commandline marks file over the stream' '
2265 cat input | git fast-import --import-marks=marks.out &&
2266 test_cmp marks.out marks.new
2271 feature import-marks=nonexistent.marks
2272 feature export-marks=combined.marks
2275 test_expect_success
'R: multiple --import-marks= should be honoured' '
2276 head -n2 marks.out > one.marks &&
2277 tail -n +3 marks.out > two.marks &&
2278 git fast-import --import-marks=one.marks --import-marks=two.marks <input &&
2279 test_cmp marks.out combined.marks
2283 feature relative-marks
2284 feature import-marks=relative.in
2285 feature export-marks=relative.out
2288 test_expect_success
'R: feature relative-marks should be honoured' '
2289 mkdir -p .git/info/fast-import/ &&
2290 cp marks.new .git/info/fast-import/relative.in &&
2291 git fast-import <input &&
2292 test_cmp marks.new .git/info/fast-import/relative.out
2296 feature relative-marks
2297 feature import-marks=relative.in
2298 feature no-relative-marks
2299 feature export-marks=non-relative.out
2302 test_expect_success
'R: feature no-relative-marks should be honoured' '
2303 git fast-import <input &&
2304 test_cmp marks.new non-relative.out
2307 test_expect_success
'R: feature ls supported' '
2312 test_expect_success
'R: feature cat-blob supported' '
2313 echo "feature cat-blob" |
2317 test_expect_success
'R: cat-blob-fd must be a nonnegative integer' '
2318 test_must_fail git fast-import --cat-blob-fd=-1 </dev/null
2321 test_expect_success
!MINGW
'R: print old blob' '
2322 blob=$(echo "yes it can" | git hash-object -w --stdin) &&
2323 cat >expect <<-EOF &&
2328 echo "cat-blob $blob" |
2329 git fast-import --cat-blob-fd=6 6>actual &&
2330 test_cmp expect actual
2333 test_expect_success
!MINGW
'R: in-stream cat-blob-fd not respected' '
2334 echo hello >greeting &&
2335 blob=$(git hash-object -w greeting) &&
2336 cat >expect <<-EOF &&
2341 git fast-import --cat-blob-fd=3 3>actual.3 >actual.1 <<-EOF &&
2344 test_cmp expect actual.3 &&
2345 test_must_be_empty actual.1 &&
2346 git fast-import 3>actual.3 >actual.1 <<-EOF &&
2347 option cat-blob-fd=3
2350 test_must_be_empty actual.3 &&
2351 test_cmp expect actual.1
2354 test_expect_success
!MINGW
'R: print mark for new blob' '
2355 echo "effluentish" | git hash-object --stdin >expect &&
2356 git fast-import --cat-blob-fd=6 6>actual <<-\EOF &&
2364 test_cmp expect actual
2367 test_expect_success
!MINGW
'R: print new blob' '
2368 blob=$(echo "yep yep yep" | git hash-object --stdin) &&
2369 cat >expect <<-EOF &&
2374 git fast-import --cat-blob-fd=6 6>actual <<-\EOF &&
2382 test_cmp expect actual
2385 test_expect_success
!MINGW
'R: print new blob by sha1' '
2386 blob=$(echo "a new blob named by sha1" | git hash-object --stdin) &&
2387 cat >expect <<-EOF &&
2389 a new blob named by sha1
2392 git fast-import --cat-blob-fd=6 6>actual <<-EOF &&
2395 a new blob named by sha1
2399 test_cmp expect actual
2402 test_expect_success
'setup: big file' '
2404 echo "the quick brown fox jumps over the lazy dog" >big &&
2407 cat big big big big >bigger &&
2408 cat bigger bigger bigger bigger >big ||
2414 test_expect_success
'R: print two blobs to stdout' '
2415 blob1=$(git hash-object big) &&
2416 blob1_len=$(wc -c <big) &&
2417 blob2=$(echo hello | git hash-object --stdin) &&
2419 echo ${blob1} blob $blob1_len &&
2429 cat <<-\END_PART1 &&
2446 git fast-import >actual &&
2447 test_cmp expect actual
2450 test_expect_success PIPE
'R: copy using cat-file' '
2451 expect_id=$(git hash-object big) &&
2452 expect_len=$(wc -c <big) &&
2453 echo $expect_id blob $expect_len >expect.response &&
2456 cat >frontend <<-\FRONTEND_END &&
2462 export GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL GIT_COMMITTER_DATE &&
2475 read blob_id type size <&3 &&
2476 echo "$blob_id $type $size" >response &&
2477 head_c $size >blob <&3 &&
2481 commit refs/heads/copied
2482 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2484 copy big file as file3
2492 git fast-import --cat-blob-fd=3 3>blobs &&
2493 git show copied:file3 >actual &&
2494 test_cmp expect.response response &&
2498 test_expect_success PIPE
'R: print blob mid-commit' '
2500 echo "A blob from _before_ the commit." >expect &&
2509 A blob from _before_ the commit.
2511 commit refs/heads/temporary
2512 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2519 read blob_id type size <&3 &&
2520 head_c $size >actual <&3 &&
2525 git fast-import --cat-blob-fd=3 3>blobs &&
2526 test_cmp expect actual
2529 test_expect_success PIPE
'R: print staged blob within commit' '
2531 echo "A blob from _within_ the commit." >expect &&
2537 commit refs/heads/within
2538 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2544 A blob from _within_ the commit.
2549 echo "A blob from _within_ the commit." |
2550 git hash-object --stdin
2552 echo "cat-blob $to_get" &&
2554 read blob_id type size <&3 &&
2555 head_c $size >actual <&3 &&
2560 git fast-import --cat-blob-fd=3 3>blobs &&
2561 test_cmp expect actual
2572 test_expect_success
'R: quiet option results in no stats being output' '
2573 cat input | git fast-import 2> output &&
2574 test_must_be_empty output
2577 test_expect_success
'R: feature done means terminating "done" is mandatory' '
2578 echo feature done | test_must_fail git fast-import &&
2579 test_must_fail git fast-import --done </dev/null
2582 test_expect_success
'R: terminating "done" with trailing gibberish is ok' '
2583 git fast-import <<-\EOF &&
2588 git fast-import <<-\EOF
2590 more trailing gibberish
2594 test_expect_success
'R: terminating "done" within commit' '
2595 cat >expect <<-\EOF &&
2597 :000000 100644 OBJID OBJID A hello.c
2598 :000000 100644 OBJID OBJID A hello2.c
2600 git fast-import <<-EOF &&
2601 commit refs/heads/done-ends
2602 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2604 Commit terminated by "done" command
2606 M 100644 inline hello.c
2613 git rev-list done-ends |
2614 git diff-tree -r --stdin --root --always |
2615 sed -e "s/$_x40/OBJID/g" >actual &&
2616 test_cmp expect actual
2620 option git non-existing-option
2623 test_expect_success
'R: die on unknown option' '
2624 test_must_fail git fast-import <input
2627 test_expect_success
'R: unknown commandline options are rejected' '\
2628 test_must_fail git fast-import --non-existing-option < /dev/null
2631 test_expect_success
'R: die on invalid option argument' '
2632 echo "option git active-branches=-5" |
2633 test_must_fail git fast-import &&
2634 echo "option git depth=" |
2635 test_must_fail git fast-import &&
2636 test_must_fail git fast-import --depth="5 elephants" </dev/null
2640 option non-existing-vcs non-existing-option
2643 test_expect_success
'R: ignore non-git options' '
2644 git fast-import <input
2648 ## R: very large blobs
2650 blobsize
=$
((2*1024*1024 + 53))
2651 test-genrandom bar
$blobsize >expect
2652 cat >input
<<INPUT_END
2653 commit refs/heads/big-file
2654 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2663 cat >>input
<<INPUT_END
2670 test_expect_success
'R: blob bigger than threshold' '
2671 test_create_repo R &&
2672 git --git-dir=R/.git fast-import --big-file-threshold=1 <input
2675 test_expect_success
'R: verify created pack' '
2678 verify_packs -v > ../verify
2682 test_expect_success
'R: verify written objects' '
2683 git --git-dir=R/.git cat-file blob big-file:big1 >actual &&
2684 test_cmp_bin expect actual &&
2685 a=$(git --git-dir=R/.git rev-parse big-file:big1) &&
2686 b=$(git --git-dir=R/.git rev-parse big-file:big2) &&
2690 test_expect_success
'R: blob appears only once' '
2691 n=$(grep $a verify | wc -l) &&
2699 # Make sure missing spaces and EOLs after mark references
2708 # commit marks: 301, 302, 303, 304
2709 # blob marks: 403, 404, resp.
2712 # The error message when a space is missing not at the
2713 # end of the line is:
2715 # Missing space after ..
2717 # or when extra characters come after the mark at the end
2722 # or when the dataref is neither "inline " or a known SHA1,
2724 # Invalid dataref ..
2728 cat >input
<<INPUT_END
2731 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2735 M 100644 inline hello.c
2742 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2747 M 100644 inline hello.c
2765 test_expect_success
'S: initialize for S tests' '
2766 git fast-import --export-marks=marks <input
2770 # filemodify, three datarefs
2772 test_expect_success
'S: filemodify with garbage after mark must fail' '
2773 test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
2775 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2779 M 100644 :403x hello.c
2782 test_i18ngrep "space after mark" err
2785 # inline is misspelled; fast-import thinks it is some unknown dataref
2786 test_expect_success
'S: filemodify with garbage after inline must fail' '
2787 test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
2789 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2793 M 100644 inlineX hello.c
2799 test_i18ngrep "nvalid dataref" err
2802 test_expect_success
'S: filemodify with garbage after sha1 must fail' '
2803 sha1=$(grep :403 marks | cut -d\ -f2) &&
2804 test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
2806 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2810 M 100644 ${sha1}x hello.c
2813 test_i18ngrep "space after SHA1" err
2817 # notemodify, three ways to say dataref
2819 test_expect_success
'S: notemodify with garabge after mark dataref must fail' '
2820 test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
2822 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2824 commit S note dataref markref
2829 test_i18ngrep "space after mark" err
2832 test_expect_success
'S: notemodify with garbage after inline dataref must fail' '
2833 test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
2835 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2837 commit S note dataref inline
2845 test_i18ngrep "nvalid dataref" err
2848 test_expect_success
'S: notemodify with garbage after sha1 dataref must fail' '
2849 sha1=$(grep :202 marks | cut -d\ -f2) &&
2850 test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
2852 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2854 commit S note dataref sha1
2859 test_i18ngrep "space after SHA1" err
2863 # notemodify, mark in commit-ish
2865 test_expect_success
'S: notemodify with garbage after mark commit-ish must fail' '
2866 test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
2867 commit refs/heads/Snotes
2868 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2870 commit S note commit-ish
2875 test_i18ngrep "after mark" err
2881 test_expect_success
'S: from with garbage after mark must fail' '
2883 git fast-import --import-marks=marks --export-marks=marks <<-EOF 2>err &&
2884 commit refs/heads/S2
2886 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2891 M 100644 :403 hello.c
2895 # go create the commit, need it for merge test
2896 git fast-import --import-marks=marks --export-marks=marks <<-EOF &&
2897 commit refs/heads/S2
2899 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2904 M 100644 :403 hello.c
2907 # now evaluate the error
2909 test_i18ngrep "after mark" err
2916 test_expect_success
'S: merge with garbage after mark must fail' '
2917 test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
2920 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2926 M 100644 :403 hello.c
2929 test_i18ngrep "after mark" err
2935 test_expect_success
'S: tag with garbage after mark must fail' '
2936 test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
2939 tagger $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
2945 test_i18ngrep "after mark" err
2951 test_expect_success
'S: cat-blob with garbage after mark must fail' '
2952 test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
2956 test_i18ngrep "after mark" err
2962 test_expect_success
'S: ls with garbage after mark must fail' '
2963 test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
2967 test_i18ngrep "space after mark" err
2970 test_expect_success
'S: ls with garbage after sha1 must fail' '
2971 sha1=$(grep :302 marks | cut -d\ -f2) &&
2972 test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
2976 test_i18ngrep "space after tree-ish" err
2982 # Setup is carried over from series S.
2984 test_expect_success
'T: ls root tree' '
2985 sed -e "s/Z\$//" >expect <<-EOF &&
2986 040000 tree $(git rev-parse S^{tree}) Z
2988 sha1=$(git rev-parse --verify S) &&
2989 git fast-import --import-marks=marks <<-EOF >actual &&
2992 test_cmp expect actual
2995 test_expect_success
'T: delete branch' '
2996 git branch to-delete &&
2997 git fast-import <<-EOF &&
2998 reset refs/heads/to-delete
2999 from 0000000000000000000000000000000000000000
3001 test_must_fail git rev-parse --verify refs/heads/to-delete
3004 test_expect_success
'T: empty reset doesnt delete branch' '
3005 git branch not-to-delete &&
3006 git fast-import <<-EOF &&
3007 reset refs/heads/not-to-delete
3010 git rev-parse --verify refs/heads/not-to-delete
3014 ### series U (filedelete)
3017 cat >input
<<INPUT_END
3019 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
3023 M 100644 inline hello.c
3027 M 100644 inline good/night.txt
3031 M 100644 inline good/bye.txt
3038 test_expect_success
'U: initialize for U tests' '
3039 git fast-import <input
3042 cat >input
<<INPUT_END
3044 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
3046 delete good/night.txt
3053 test_expect_success
'U: filedelete file succeeds' '
3054 git fast-import <input
3058 :100644 000000 2907ebb4bf85d91bf0716bb3bd8a68ef48d6da76 0000000000000000000000000000000000000000 D good/night.txt
3061 git diff-tree
-M -r U^
1 U
>actual
3063 test_expect_success
'U: validate file delete result' '
3064 compare_diff_raw expect actual
3067 cat >input
<<INPUT_END
3069 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
3078 test_expect_success
'U: filedelete directory succeeds' '
3079 git fast-import <input
3083 :100644 000000 69cb75792f55123d8389c156b0b41c2ff00ed507 0000000000000000000000000000000000000000 D good/bye.txt
3086 git diff-tree
-M -r U^
1 U
>actual
3088 test_expect_success
'U: validate directory delete result' '
3089 compare_diff_raw expect actual
3092 cat >input
<<INPUT_END
3094 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
3103 test_expect_success
'U: filedelete root succeeds' '
3104 git fast-import <input
3108 :100644 000000 c18147dc648481eeb65dc5e66628429a64843327 0000000000000000000000000000000000000000 D hello.c
3111 git diff-tree
-M -r U^
1 U
>actual
3113 test_expect_success
'U: validate root delete result' '
3114 compare_diff_raw expect actual