Skip to content

Commit 93c3d29

Browse files
tboegigitster
authored andcommitted
git mv foo FOO ; git mv foo bar gave an assert
The following sequence, on a case-insensitive file system, (strictly speeking with core.ignorecase=true) leads to an assertion failure and leaves .git/index.lock behind. git init echo foo >foo git add foo git mv foo FOO git mv foo bar This regression was introduced in Commit 9b906af, "git-mv: improve error message for conflicted file" The bugfix is to change the "file exist case-insensitive in the index" into the correct "file exist (case-sensitive) in the index". This avoids the "assert" later in the code and keeps setting up the "ce" pointer for ce_stage(ce) done in the next else if. This fixes git-for-windows#2920 Reported-By: Dan Moseley <[email protected]> Signed-off-by: Torsten Bögershausen <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9b906af commit 93c3d29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/mv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
221221
}
222222
argc += last - first;
223223
}
224-
} else if (!(ce = cache_file_exists(src, length, ignore_case))) {
224+
} else if (!(ce = cache_file_exists(src, length, 0))) {
225225
bad = _("not under version control");
226226
} else if (ce_stage(ce)) {
227227
bad = _("conflicted");

0 commit comments

Comments
 (0)