Merge branch 'en/merge-recursive-icase-removal'
authorJunio C Hamano <gitster@pobox.com>
Tue, 19 Dec 2017 19:33:55 +0000 (11:33 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 Dec 2017 19:33:55 +0000 (11:33 -0800)
The code internal to the recursive merge strategy was not fully
prepared to see a path that is renamed to try overwriting another
path that is only different in case on case insensitive systems.
This does not matter in the current code, but will start to matter
once the rename detection logic starts taking hints from nearby
paths moving to some directory and moves a new path along with them.

* en/merge-recursive-icase-removal:
merge-recursive: ignore_case shouldn't reject intentional removals

merge-recursive.c
index a4c280dfc78e943ec541f83ccb0b39921ccdf2b2..2ecf495cc2a4a6d4544b92db1d2a8c3c0cc36f87 100644 (file)
@@ -646,7 +646,7 @@ static int remove_file(struct merge_options *o, int clean,
                if (ignore_case) {
                        struct cache_entry *ce;
                        ce = cache_file_exists(path, strlen(path), ignore_case);
-                       if (ce && ce_stage(ce) == 0)
+                       if (ce && ce_stage(ce) == 0 && strcmp(path, ce->name))
                                return 0;
                }
                if (remove_path(path))