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 /read-cache.c | |
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 'read-cache.c')
-rw-r--r-- | read-cache.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/read-cache.c b/read-cache.c index 670a06bc79..5a9704f4e5 100644 --- a/read-cache.c +++ b/read-cache.c @@ -46,7 +46,7 @@ static void replace_index_entry(struct index_state *istate, int nr, struct cache { struct cache_entry *old = istate->cache[nr]; - remove_name_hash(old); + remove_name_hash(istate, old); set_index_entry(istate, nr, ce); istate->cache_changed = 1; } @@ -460,7 +460,7 @@ int remove_index_entry_at(struct index_state *istate, int pos) struct cache_entry *ce = istate->cache[pos]; record_resolve_undo(istate, ce); - remove_name_hash(ce); + remove_name_hash(istate, ce); istate->cache_changed = 1; istate->cache_nr--; if (pos >= istate->cache_nr) @@ -483,7 +483,7 @@ void remove_marked_cache_entries(struct index_state *istate) for (i = j = 0; i < istate->cache_nr; i++) { if (ce_array[i]->ce_flags & CE_REMOVE) - remove_name_hash(ce_array[i]); + remove_name_hash(istate, ce_array[i]); else ce_array[j++] = ce_array[i]; } @@ -1515,8 +1515,7 @@ int discard_index(struct index_state *istate) istate->cache_changed = 0; istate->timestamp.sec = 0; istate->timestamp.nsec = 0; - istate->name_hash_initialized = 0; - free_hash(&istate->name_hash); + free_name_hash(istate); cache_tree_free(&(istate->cache_tree)); istate->initialized = 0; |