Thread (1 message) 1 message, 1 author, 2021-03-01

Re: [EXTERNAL] [PATCH v2 1/1] git mv foo FOO ; git mv foo bar gave an assert

From: Junio C Hamano <hidden>
Date: 2021-03-01 21:51:00

Dan Moseley [off-list ref] writes:
Thank you Thorsten. This makes sense to me. Do you want to add a test? 
I believe this is what I had in my original patch, that worked pretty well:
Would this succeed unconditionally on all platforms, or only
relevant on case-insensitive filesystems?  Lack of any prerequisite
on a new test is a good thing (if it is correct), but the
description of the change talked about case insensitivity, so ...
quoted hunk
diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh
index 63d5f41a12..5c7fee9bd8 100755
--- a/t/t7001-mv.sh
+++ b/t/t7001-mv.sh
@@ -152,6 +152,14 @@ test_expect_success \
     'move into "."' \
     'git mv path1/path2/ .'

+test_expect_success \
+    'fail to move file already in index under different cased name' \
+    'echo 1 > foo &&
+     git add foo &&
+     git commit -m add_file -- foo &&
+     git mv foo FOO &&
+     test_expect_code 128 git mv foo BAR'
+
 test_expect_success "Michael Cassar's test case" '
        rm -fr .git papers partA &&
        git init &&
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help