@matheusbsbs / matheus-bagliano / commits / 0a9b88b7de
Fork 0

Add 'core.ignorecase' option

..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>

Linus Torvalds committed Mar 21, 2008 at 16:52 UTC 0a9b88b7dee70bd36d35b7857640a18ee3adeef1
4 files changed +8 -1
cache.h
+1
@@ -407,6 +407,7 @@ extern int delete_ref(const char *, const unsigned char *sha1);
407 extern int trust_executable_bit;
408 extern int quote_path_fully;
409 extern int has_symlinks;
410 +extern int ignore_case;
411 extern int assume_unchanged;
412 extern int prefer_symlink_refs;
413 extern int log_all_ref_updates;
config.c
+5
@@ -342,6 +342,11 @@ int git_default_config(const char *var, const char *value)
342 return 0;
343 }
344
345 + if (!strcmp(var, "core.ignorecase")) {
346 + ignore_case = git_config_bool(var, value);
347 + return 0;
348 + }
349 +
350 if (!strcmp(var, "core.bare")) {
351 is_bare_repository_cfg = git_config_bool(var, value);
352 return 0;
dir.c
+1 -1
@@ -371,7 +371,7 @@ static struct dir_entry *dir_entry_new(const char *pathname, int len)
371
372 struct dir_entry *dir_add_name(struct dir_struct *dir, const char *pathname, int len)
373 {
374 - if (cache_name_exists(pathname, len, 0))
374 + if (cache_name_exists(pathname, len, ignore_case))
375 return NULL;
376
377 ALLOC_GROW(dir->entries, dir->nr+1, dir->alloc);
environment.c
+1
@@ -14,6 +14,7 @@ char git_default_name[MAX_GITNAME];
14 int trust_executable_bit = 1;
15 int quote_path_fully = 1;
16 int has_symlinks = 1;
17 +int ignore_case;
18 int assume_unchanged;
19 int prefer_symlink_refs;
20 int is_bare_repository_cfg = -1; /* unspecified */