test_expect_success \
'A: verify commit' \
'git-cat-file commit master | sed 1d >actual &&
- diff -u expect actual'
+ git diff expect actual'
cat >expect <<EOF
100644 blob file2
test_expect_success \
'A: verify tree' \
'git-cat-file -p master^{tree} | sed "s/ [0-9a-f]* / /" >actual &&
- diff -u expect actual'
+ git diff expect actual'
echo "$file2_data" >expect
test_expect_success \
'A: verify file2' \
- 'git-cat-file blob master:file2 >actual && diff -u expect actual'
+ 'git-cat-file blob master:file2 >actual && git diff expect actual'
echo "$file3_data" >expect
test_expect_success \
'A: verify file3' \
- 'git-cat-file blob master:file3 >actual && diff -u expect actual'
+ 'git-cat-file blob master:file3 >actual && git diff expect actual'
printf "$file4_data" >expect
test_expect_success \
'A: verify file4' \
- 'git-cat-file blob master:file4 >actual && diff -u expect actual'
+ 'git-cat-file blob master:file4 >actual && git diff expect actual'
cat >expect <<EOF
:2 `git-rev-parse --verify master:file2`
EOF
test_expect_success \
'A: verify marks output' \
- 'diff -u expect marks.out'
+ 'git diff expect marks.out'
test_expect_success \
'A: verify marks import' \
--import-marks=marks.out \
--export-marks=marks.new \
</dev/null &&
- diff -u expect marks.new'
+ git diff -u expect marks.new'
+
+test_tick
+cat >input <<INPUT_END
+commit refs/heads/verify--import-marks
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+data <<COMMIT
+recreate from :5
+COMMIT
+
+from :5
+M 755 :2 copy-of-file2
+
+INPUT_END
+test_expect_success \
+ 'A: verify marks import does not crash' \
+ 'git-fast-import --import-marks=marks.out <input &&
+ git-whatchanged verify--import-marks'
+test_expect_success \
+ 'A: verify pack' \
+ 'for p in .git/objects/pack/*.pack;do git-verify-pack $p||exit;done'
+cat >expect <<EOF
+:000000 100755 0000000000000000000000000000000000000000 7123f7f44e39be127c5eb701e5968176ee9d78b1 A copy-of-file2
+EOF
+git-diff-tree -M -r master verify--import-marks >actual
+test_expect_success \
+ 'A: verify diff' \
+ 'compare_diff_raw expect actual &&
+ test `git-rev-parse --verify master:file2` \
+ = `git-rev-parse --verify verify--import-marks:copy-of-file2`'
###
### series B
test_expect_success \
'C: verify commit' \
'git-cat-file commit branch | sed 1d >actual &&
- diff -u expect actual'
+ git diff expect actual'
cat >expect <<EOF
:000000 100755 0000000000000000000000000000000000000000 f1fb5da718392694d0076d677d6d0e364c79b0bc A file2/newf
test_expect_success \
'D: verify file5' \
'git-cat-file blob branch:newdir/interesting >actual &&
- diff -u expect actual'
+ git diff expect actual'
echo "$file6_data" >expect
test_expect_success \
'D: verify file6' \
'git-cat-file blob branch:newdir/exec.sh >actual &&
- diff -u expect actual'
+ git diff expect actual'
###
### series E
test_expect_success \
'E: verify commit' \
'git-cat-file commit branch | sed 1,2d >actual &&
- diff -u expect actual'
+ git diff expect actual'
###
### series F
test_expect_success \
'F: verify other commit' \
'git-cat-file commit other >actual &&
- diff -u expect actual'
+ git diff expect actual'
###
### series G
test_expect_success \
'H: verify file' \
'git-cat-file blob H:h/e/l/lo >actual &&
- diff -u expect actual'
+ git diff expect actual'
###
### series I
test_expect_success \
'I: verify edge list' \
'sed -e s/pack-.*pack/pack-.pack/ edges.list >actual &&
- diff -u expect actual'
+ git diff expect actual'
###
### series J
'test `git-rev-parse --verify branch^1` \
= `git-rev-parse --verify K^1`'
+###
+### series L
+###
+
+cat >input <<INPUT_END
+blob
+mark :1
+data <<EOF
+some data
+EOF
+
+blob
+mark :2
+data <<EOF
+other data
+EOF
+
+commit refs/heads/L
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+data <<COMMIT
+create L
+COMMIT
+
+M 644 :1 b.
+M 644 :1 b/other
+M 644 :1 ba
+
+commit refs/heads/L
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+data <<COMMIT
+update L
+COMMIT
+
+M 644 :2 b.
+M 644 :2 b/other
+M 644 :2 ba
+INPUT_END
+
+cat >expect <<EXPECT_END
+:100644 100644 4268632... 55d3a52... M b.
+:040000 040000 0ae5cac... 443c768... M b
+:100644 100644 4268632... 55d3a52... M ba
+EXPECT_END
+
+test_expect_success \
+ 'L: verify internal tree sorting' \
+ 'git-fast-import <input &&
+ git-diff --raw L^ L >output &&
+ git diff expect output'
+
test_done