diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-04-01 08:59:53 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-01 08:59:53 -0700 |
commit | c044bed8f0ed0275792cf66201579e42c0de7171 (patch) | |
tree | f39c9e19c58b25b9e88a25f3f5648fd496d7a1b6 /cache.h | |
parent | e81890548c2deff5a642ba1917e31742bfb15b96 (diff) | |
parent | 2092678cd5265e40dfb2b8e3adc8f2075faeece4 (diff) | |
download | git-c044bed8f0ed0275792cf66201579e42c0de7171.tar.gz |
Merge branch 'kb/name-hash'
The code to keep track of what directory names are known to Git on
platforms with case insensitive filesystems can get confused upon
a hash collision between these pathnames and looped forever.
* kb/name-hash:
name-hash.c: fix endless loop with core.ignorecase=true
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 17 |
1 files changed, 3 insertions, 14 deletions
@@ -132,7 +132,6 @@ struct cache_entry { unsigned int ce_namelen; unsigned char sha1[20]; struct cache_entry *next; - struct cache_entry *dir_next; char name[FLEX_ARRAY]; /* more */ }; @@ -268,25 +267,15 @@ struct index_state { unsigned name_hash_initialized : 1, initialized : 1; struct hash_table name_hash; + struct hash_table dir_hash; }; extern struct index_state the_index; /* Name hashing */ extern void add_name_hash(struct index_state *istate, struct cache_entry *ce); -/* - * We don't actually *remove* it, we can just mark it invalid so that - * we won't find it in lookups. - * - * Not only would we have to search the lists (simple enough), but - * we'd also have to rehash other hash buckets in case this makes the - * hash bucket empty (common). So it's much better to just mark - * it. - */ -static inline void remove_name_hash(struct cache_entry *ce) -{ - ce->ce_flags |= CE_UNHASHED; -} +extern void remove_name_hash(struct index_state *istate, struct cache_entry *ce); +extern void free_name_hash(struct index_state *istate); #ifndef NO_THE_INDEX_COMPATIBILITY_MACROS |