summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-10-17 21:37:11 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-10-17 21:37:11 -0700
commit6f55f0281558f56a0141f3058f245d0877e80efb (patch)
tree1c581b79a00dd7df5e8d240797b27970c87f5272
parentMerge branch 'ef/mingw-syslog' (diff)
parentfix phantom untracked files when core.ignorecase is set (diff)
downloadtgif-6f55f0281558f56a0141f3058f245d0877e80efb.tar.xz
Merge branch 'jk/name-hash-dirent'
* jk/name-hash-dirent: fix phantom untracked files when core.ignorecase is set
-rw-r--r--cache.h1
-rw-r--r--name-hash.c15
2 files changed, 9 insertions, 7 deletions
diff --git a/cache.h b/cache.h
index e39e160018..85c099655e 100644
--- a/cache.h
+++ b/cache.h
@@ -168,6 +168,7 @@ struct cache_entry {
unsigned int ce_flags;
unsigned char sha1[20];
struct cache_entry *next;
+ struct cache_entry *dir_next;
char name[FLEX_ARRAY]; /* more */
};
diff --git a/name-hash.c b/name-hash.c
index c6b6a3fe4c..225dd76995 100644
--- a/name-hash.c
+++ b/name-hash.c
@@ -57,12 +57,10 @@ static void hash_index_entry_directories(struct index_state *istate, struct cach
if (*ptr == '/') {
++ptr;
hash = hash_name(ce->name, ptr - ce->name);
- if (!lookup_hash(hash, &istate->name_hash)) {
- pos = insert_hash(hash, ce, &istate->name_hash);
- if (pos) {
- ce->next = *pos;
- *pos = ce;
- }
+ pos = insert_hash(hash, ce, &istate->name_hash);
+ if (pos) {
+ ce->dir_next = *pos;
+ *pos = ce;
}
}
}
@@ -166,7 +164,10 @@ struct cache_entry *index_name_exists(struct index_state *istate, const char *na
if (same_name(ce, name, namelen, icase))
return ce;
}
- ce = ce->next;
+ if (icase && name[namelen - 1] == '/')
+ ce = ce->dir_next;
+ else
+ ce = ce->next;
}
/*