From: Joshua Jensen Date: Sun, 3 Oct 2010 09:56:46 +0000 (+0000) Subject: Support case folding in git fast-import when core.ignorecase=true X-Git-Tag: v1.7.4-rc0~94^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=50906e04e8f48215b0b09841686709b92a2ab2e4;p=git.git Support case folding in git fast-import when core.ignorecase=true When core.ignorecase=true, imported file paths will be folded to match existing directory case. Signed-off-by: Joshua Jensen Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano --- diff --git a/fast-import.c b/fast-import.c index ddad289da..c3abe554c 100644 --- a/fast-import.c +++ b/fast-import.c @@ -156,6 +156,7 @@ Format of STDIN stream: #include "csum-file.h" #include "quote.h" #include "exec_cmd.h" +#include "dir.h" #define PACK_ID_BITS 16 #define MAX_PACK_ID ((1<entry_count; i++) { e = t->entries[i]; - if (e->name->str_len == n && !strncmp(p, e->name->str_dat, n)) { + if (e->name->str_len == n && !strncmp_icase(p, e->name->str_dat, n)) { if (!slash1) { if (!S_ISDIR(mode) && e->versions[1].mode == mode @@ -1527,7 +1528,7 @@ static int tree_content_remove( for (i = 0; i < t->entry_count; i++) { e = t->entries[i]; - if (e->name->str_len == n && !strncmp(p, e->name->str_dat, n)) { + if (e->name->str_len == n && !strncmp_icase(p, e->name->str_dat, n)) { if (!slash1 || !S_ISDIR(e->versions[1].mode)) goto del_entry; if (!e->tree) @@ -1577,7 +1578,7 @@ static int tree_content_get( for (i = 0; i < t->entry_count; i++) { e = t->entries[i]; - if (e->name->str_len == n && !strncmp(p, e->name->str_dat, n)) { + if (e->name->str_len == n && !strncmp_icase(p, e->name->str_dat, n)) { if (!slash1) { memcpy(leaf, e, sizeof(*leaf)); if (e->tree && is_null_sha1(e->versions[1].sha1))