From: Junio C Hamano Date: Wed, 25 Jun 2014 18:48:34 +0000 (-0700) Subject: Merge branch 'dt/merge-recursive-case-insensitive' into maint X-Git-Tag: v2.0.1~10 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/5fa38cc3a47c197a352dc52a1b373162c84b8697?hp=-c Merge branch 'dt/merge-recursive-case-insensitive' into maint On a case insensitive filesystem, merge-recursive incorrectly deleted the file that is to be renamed to a name that is the same except for case differences. * dt/merge-recursive-case-insensitive: mv: allow renaming to fix case on case insensitive filesystems merge-recursive.c: fix case-changing merge bug --- 5fa38cc3a47c197a352dc52a1b373162c84b8697 diff --combined builtin/mv.c index 2a7243f52e,f4d89d0640..180ef99127 --- a/builtin/mv.c +++ b/builtin/mv.c @@@ -162,8 -162,7 +162,8 @@@ int cmd_mv(int argc, const char **argv if (strncmp(path, src_w_slash, len_w_slash)) break; } - free((char *)src_w_slash); + if (src_w_slash != src) + free((char *)src_w_slash); if (last - first < 1) bad = _("source directory is empty"); @@@ -203,7 -202,8 +203,8 @@@ } } else if (cache_name_pos(src, length) < 0) bad = _("not under version control"); - else if (lstat(dst, &st) == 0) { + else if (lstat(dst, &st) == 0 && + (!ignore_case || strcasecmp(src, dst))) { bad = _("destination exists"); if (force) { /*