aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-12-16 17:39:06 -0800
committerJunio C Hamano <junkio@cox.net>2006-12-17 01:14:44 -0800
commit81a361be3b12f393d402c5da63191c11c18ea6a9 (patch)
tree5f0b4d5c59c5e3aab6820c516628c51b86e1fe4a /t
parentc33ab0dd100d91d417b5ed3378acbf3310c07cec (diff)
downloadgit-81a361be3b12f393d402c5da63191c11c18ea6a9.tar.gz
git-81a361be3b12f393d402c5da63191c11c18ea6a9.tar.xz
Fix check_file_directory_conflict().
When replacing an existing file A with a directory A that has a file A/B in it in the index, 'update-index --replace --add A/B' did not properly remove the file to make room for the new directory. There was a trivial logic error, most likely a cut & paste one, dating back to quite early days of git. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't')
-rwxr-xr-xt/t0000-basic.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index 3260d1d7a..0cd1c4186 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -272,4 +272,13 @@ test_expect_success \
wc -l) &&
test $numparent = 1'
+test_expect_success 'update-index D/F conflict' '
+ mv path0 tmp &&
+ mv path2 path0 &&
+ mv tmp path2 &&
+ git update-index --add --replace path2 path0/file2 &&
+ numpath0=$(git ls-files path0 | wc -l) &&
+ test $numpath0 = 1
+'
+
test_done