path: root/t/
diff options
authorJeff King <>2013-04-04 19:03:58 (GMT)
committerJunio C Hamano <>2013-04-04 19:28:53 (GMT)
commit96ec8ee92aad52b6556e87d0166a7b9c4cd7c324 (patch)
treed6981aa8c30e895a8c5cb06910a363c79db3326a /t/
parent9a6728d4d14a08791861a63b7567ee0b50e59f70 (diff)
t3600: test behavior of reverse-d/f conflict
The previous commit taught "rm" that it is safe to consider "d/f" removed when "d" has become a non-directory. This patch adds a test for the opposite: a file "d" that becomes a directory. In this case, "git rm" does need to complain, because we should not be removing arbitrary content under "d". Git already behaves correctly, but let's make sure that remains the case by protecting the behavior with a test. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't/')
1 files changed, 12 insertions, 0 deletions
diff --git a/t/ b/t/
index 73772b2..a2e1a03 100755
--- a/t/
+++ b/t/
@@ -647,4 +647,16 @@ test_expect_success SYMLINKS 'rm of d/f when d has become a dangling symlink' '
test_path_is_missing d
+test_expect_success 'rm of file when it has become a directory' '
+ rm -rf d &&
+ >d &&
+ git add d &&
+ rm -f d &&
+ mkdir d &&
+ >d/f &&
+ test_must_fail git rm d &&
+ git rev-parse --verify :d &&
+ test_path_is_file d/f