]> Pileus Git - ~andy/git/commitdiff
Add 'core.ignorecase' option
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 21 Mar 2008 23:52:46 +0000 (16:52 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 9 Apr 2008 08:22:25 +0000 (01:22 -0700)
..and start using it for directory entry traversal (ie "git status" will
not consider entries that match an existing entry case-insensitively to
be a new file)

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
config.c
dir.c
environment.c

diff --git a/cache.h b/cache.h
index a9ddaa12400bffce84bfd56674dee97b9fe810fc..9bce723bb88ba4c97f0c1b80abf090ea82fe919b 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -407,6 +407,7 @@ extern int delete_ref(const char *, const unsigned char *sha1);
 extern int trust_executable_bit;
 extern int quote_path_fully;
 extern int has_symlinks;
+extern int ignore_case;
 extern int assume_unchanged;
 extern int prefer_symlink_refs;
 extern int log_all_ref_updates;
index 062449459e1a4cfc2a605c065ed281669e0e7452..3d51868f2b616859b2676d6c50633d8aa00eb641 100644 (file)
--- a/config.c
+++ b/config.c
@@ -342,6 +342,11 @@ int git_default_config(const char *var, const char *value)
                return 0;
        }
 
+       if (!strcmp(var, "core.ignorecase")) {
+               ignore_case = git_config_bool(var, value);
+               return 0;
+       }
+
        if (!strcmp(var, "core.bare")) {
                is_bare_repository_cfg = git_config_bool(var, value);
                return 0;
diff --git a/dir.c b/dir.c
index 7362e8328290eb22e8bed0e6c1782863bc4c1d0d..b5bfbcaac74ffca2483a378554b279d3470bc021 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -371,7 +371,7 @@ static struct dir_entry *dir_entry_new(const char *pathname, int len)
 
 struct dir_entry *dir_add_name(struct dir_struct *dir, const char *pathname, int len)
 {
-       if (cache_name_exists(pathname, len, 0))
+       if (cache_name_exists(pathname, len, ignore_case))
                return NULL;
 
        ALLOC_GROW(dir->entries, dir->nr+1, dir->alloc);
index 6739a3f41745fe1c01dc767e09af8746d6f2815f..3c816824299cc82d3ed54782357aa1cf49346120 100644 (file)
@@ -14,6 +14,7 @@ char git_default_name[MAX_GITNAME];
 int trust_executable_bit = 1;
 int quote_path_fully = 1;
 int has_symlinks = 1;
+int ignore_case;
 int assume_unchanged;
 int prefer_symlink_refs;
 int is_bare_repository_cfg = -1; /* unspecified */