git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Joshua Jensen <jjensen@workspacewhiz.com>
To: git@vger.kernel.org
Cc: j6t@kdbg.org
Subject: [PATCH v2 6/6] Support case folding in git fast-import when core.ignorecase=true
Date: Sat, 02 Oct 2010 22:32:57 -0600	[thread overview]
Message-ID: <20101003043257.1960.60639.stgit@SlamDunk> (raw)
In-Reply-To: <20101003043221.1960.73178.stgit@SlamDunk>

When core.ignorecase=true, imported file paths will be folded to match
existing directory case.

Signed-off-by: Joshua Jensen <jjensen@workspacewhiz.com>
---
 fast-import.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/fast-import.c b/fast-import.c
index 2317b0f..e214048 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<<PACK_ID_BITS)-1)
@@ -1461,7 +1462,7 @@ static int tree_content_set(
 
 	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) {
 				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))
 				/*
 				 * If p names a file in some subdirectory, and a
@@ -1585,7 +1586,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))

  parent reply	other threads:[~2010-10-03  4:33 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-03  4:32 [PATCH v2 0/6] Extensions of core.ignorecase=true support Joshua Jensen
2010-10-03  4:32 ` [PATCH v2 1/6] Add string comparison functions that respect the ignore_case variable Joshua Jensen
2010-10-03  8:30   ` Ævar Arnfjörð Bjarmason
2010-10-03  9:07     ` Joshua Jensen
2010-10-03  9:56       ` [PATCH/RFC v3 0/8] ab/icase-directory: jj/icase-directory with Makefile + configure checks Ævar Arnfjörð Bjarmason
2010-10-03  9:56       ` [PATCH/RFC v3 1/8] Makefile & configure: add a NO_FNMATCH flag Ævar Arnfjörð Bjarmason
2010-10-03  9:56       ` [PATCH/RFC v3 2/8] Makefile & configure: add a NO_FNMATCH_CASEFOLD flag Ævar Arnfjörð Bjarmason
2010-10-03 17:58         ` Johannes Sixt
2010-10-04  2:48           ` [PATCH/RFC v4 " Ævar Arnfjörð Bjarmason
2010-10-03  9:56       ` [PATCH/RFC v3 3/8] Add string comparison functions that respect the ignore_case variable Ævar Arnfjörð Bjarmason
2010-10-03  9:56       ` [PATCH/RFC v3 4/8] Case insensitivity support for .gitignore via core.ignorecase Ævar Arnfjörð Bjarmason
2010-10-03  9:56       ` [PATCH/RFC v3 5/8] Add case insensitivity support for directories when using git status Ævar Arnfjörð Bjarmason
2010-10-03  9:56       ` [PATCH/RFC v3 6/8] Add case insensitivity support when using git ls-files Ævar Arnfjörð Bjarmason
2010-10-03 11:54         ` Thomas Adam
2010-10-03 18:19           ` Johannes Sixt
2010-10-03 21:59             ` Thomas Adam
2010-10-04  7:49             ` Jonathan Nieder
2010-10-04  8:02               ` Ævar Arnfjörð Bjarmason
2010-10-04 14:03               ` Erik Faye-Lund
2010-10-04 14:58                 ` Joshua Jensen
2010-10-04 17:03                   ` Jonathan Nieder
2010-10-04 16:02         ` Robin Rosenberg
2010-10-04 16:41           ` Ævar Arnfjörð Bjarmason
2010-10-04 16:48           ` Erik Faye-Lund
2010-10-04 16:49           ` Joshua Jensen
2010-10-04 17:08             ` Jonathan Nieder
2010-10-04 17:53             ` Ævar Arnfjörð Bjarmason
2010-10-04 19:02           ` Johannes Sixt
2010-10-04 19:17             ` Ævar Arnfjörð Bjarmason
2010-10-03  9:56       ` [PATCH/RFC v3 7/8] Support case folding for git add when core.ignorecase=true Ævar Arnfjörð Bjarmason
2010-10-03  9:56       ` [PATCH/RFC v3 8/8] Support case folding in git fast-import " Ævar Arnfjörð Bjarmason
2010-10-07  4:13       ` [PATCH v2 1/6] Add string comparison functions that respect the ignore_case variable Junio C Hamano
2010-10-07  5:48         ` Joshua Jensen
2010-10-03  4:32 ` [PATCH v2 2/6] Case insensitivity support for .gitignore via core.ignorecase Joshua Jensen
2010-10-03  4:32 ` [PATCH v2 3/6] Add case insensitivity support for directories when using git status Joshua Jensen
2010-10-03  4:32 ` [PATCH v2 4/6] Add case insensitivity support when using git ls-files Joshua Jensen
2010-10-03  4:32 ` [PATCH v2 5/6] Support case folding for git add when core.ignorecase=true Joshua Jensen
2010-10-03  4:32 ` Joshua Jensen [this message]
2010-10-03 13:00   ` [PATCH v2 6/6] Support case folding in git fast-import " Sverre Rabbelier
2010-10-03  8:17 ` [PATCH v2 0/6] Extensions of core.ignorecase=true support Johannes Sixt
2010-10-03 23:34   ` Junio C Hamano
2010-10-03 11:48 ` Robert Buck
2010-10-03 18:12   ` Johannes Sixt
2010-10-06 22:04     ` Robert Buck
2010-10-06 22:46       ` Joshua Jensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101003043257.1960.60639.stgit@SlamDunk \
    --to=jjensen@workspacewhiz.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).