@@ -874,6 +874,48 @@ test_expect_success \
874874 git diff-tree -C --find-copies-harder -r N4^ N4 >actual &&
875875 compare_diff_raw expect actual'
876876
877+ test_expect_success \
878+ ' N: delete directory by copying' \
879+ ' cat >expect <<-\EOF &&
880+ OBJID
881+ :100644 000000 OBJID OBJID D foo/bar/qux
882+ OBJID
883+ :000000 100644 OBJID OBJID A foo/bar/baz
884+ :000000 100644 OBJID OBJID A foo/bar/qux
885+ EOF
886+ empty_tree=$(git mktree </dev/null) &&
887+ cat >input <<-INPUT_END &&
888+ commit refs/heads/N-delete
889+ committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
890+ data <<COMMIT
891+ collect data to be deleted
892+ COMMIT
893+
894+ deleteall
895+ M 100644 inline foo/bar/baz
896+ data <<DATA_END
897+ hello
898+ DATA_END
899+ C "foo/bar/baz" "foo/bar/qux"
900+ C "foo/bar/baz" "foo/bar/quux/1"
901+ C "foo/bar/baz" "foo/bar/quuux"
902+ M 040000 $empty_tree foo/bar/quux
903+ M 040000 $empty_tree foo/bar/quuux
904+
905+ commit refs/heads/N-delete
906+ committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
907+ data <<COMMIT
908+ delete subdirectory
909+ COMMIT
910+
911+ M 040000 $empty_tree foo/bar/qux
912+ INPUT_END
913+ git fast-import <input &&
914+ git rev-list N-delete |
915+ git diff-tree -r --stdin --root --always |
916+ sed -e "s/$_x40/OBJID/g" >actual &&
917+ test_cmp expect actual'
918+
877919test_expect_success \
878920 ' N: modify copied tree' \
879921 ' cat >expect <<-\EOF &&
0 commit comments