@@ -1031,6 +1031,32 @@ test_expect_success \
1031
1031
git diff-tree -M -r M3^ M3 >actual &&
1032
1032
compare_diff_raw expect actual'
1033
1033
1034
+ cat > input << INPUT_END
1035
+ commit refs/heads/M4
1036
+ committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL > $GIT_COMMITTER_DATE
1037
+ data <<COMMIT
1038
+ rename root
1039
+ COMMIT
1040
+
1041
+ from refs/heads/M2^0
1042
+ R "" sub
1043
+
1044
+ INPUT_END
1045
+
1046
+ cat > expect << EOF
1047
+ :100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 R100 file2/oldf sub/file2/oldf
1048
+ :100755 100755 85df50785d62d3b05ab03d9cbf7e4a0b49449730 85df50785d62d3b05ab03d9cbf7e4a0b49449730 R100 file4 sub/file4
1049
+ :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc R100 i/am/new/to/you sub/i/am/new/to/you
1050
+ :100755 100755 e74b7d465e52746be2b4bae983670711e6e66657 e74b7d465e52746be2b4bae983670711e6e66657 R100 newdir/exec.sh sub/newdir/exec.sh
1051
+ :100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 R100 newdir/interesting sub/newdir/interesting
1052
+ EOF
1053
+ test_expect_failure \
1054
+ ' M: rename root to subdirectory' \
1055
+ ' git fast-import <input &&
1056
+ git diff-tree -M -r M4^ M4 >actual &&
1057
+ cat actual &&
1058
+ compare_diff_raw expect actual'
1059
+
1034
1060
# ##
1035
1061
# ## series N
1036
1062
# ##
@@ -1227,6 +1253,29 @@ test_expect_success \
1227
1253
git diff-tree -C --find-copies-harder -r N4 N6 >actual &&
1228
1254
compare_diff_raw expect actual'
1229
1255
1256
+ test_expect_failure \
1257
+ ' N: copy root by path' \
1258
+ ' cat >expect <<-\EOF &&
1259
+ :100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100 file2/newf oldroot/file2/newf
1260
+ :100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100 file2/oldf oldroot/file2/oldf
1261
+ :100755 100755 85df50785d62d3b05ab03d9cbf7e4a0b49449730 85df50785d62d3b05ab03d9cbf7e4a0b49449730 C100 file4 oldroot/file4
1262
+ :100755 100755 e74b7d465e52746be2b4bae983670711e6e66657 e74b7d465e52746be2b4bae983670711e6e66657 C100 newdir/exec.sh oldroot/newdir/exec.sh
1263
+ :100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 C100 newdir/interesting oldroot/newdir/interesting
1264
+ EOF
1265
+ cat >input <<-INPUT_END &&
1266
+ commit refs/heads/N-copy-root-path
1267
+ committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
1268
+ data <<COMMIT
1269
+ copy root directory by (empty) path
1270
+ COMMIT
1271
+
1272
+ from refs/heads/branch^0
1273
+ C "" oldroot
1274
+ INPUT_END
1275
+ git fast-import <input &&
1276
+ git diff-tree -C --find-copies-harder -r branch N-copy-root-path >actual &&
1277
+ compare_diff_raw expect actual'
1278
+
1230
1279
test_expect_success \
1231
1280
' N: delete directory by copying' \
1232
1281
' cat >expect <<-\EOF &&
@@ -2934,4 +2983,20 @@ test_expect_success 'S: ls with garbage after sha1 must fail' '
2934
2983
test_i18ngrep "space after tree-ish" err
2935
2984
'
2936
2985
2986
+ # ##
2987
+ # ## series T (ls)
2988
+ # ##
2989
+ # Setup is carried over from series S.
2990
+
2991
+ test_expect_failure ' T: ls root tree' '
2992
+ sed -e "s/Z\$//" >expect <<-EOF &&
2993
+ 040000 tree $(git rev-parse S^{tree}) Z
2994
+ EOF
2995
+ sha1=$(git rev-parse --verify S) &&
2996
+ git fast-import --import-marks=marks <<-EOF >actual &&
2997
+ ls $sha1 ""
2998
+ EOF
2999
+ test_cmp expect actual
3000
+ '
3001
+
2937
3002
test_done
0 commit comments