diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2014-06-13 14:19:26 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-06-13 20:49:38 +0200 |
commit | ad837d9ef9d555ab5077767c8672ff48c6cb562b (patch) | |
tree | bcc4182a6bc56281727669cd245341fc1985d665 | |
parent | read-cache: store in-memory flags in the first 12 bits of ce_flags (diff) | |
download | git-ad837d9ef9d555ab5077767c8672ff48c6cb562b.tar.xz git-ad837d9ef9d555ab5077767c8672ff48c6cb562b.zip |
read-cache: be strict about "changed" in remove_marked_cache_entries()
remove_marked_cache_entries() deletes entries marked with
CE_REMOVE. But if there is no such entry, do not mark the index as
"changed" because that could trigger an index update unnecessarily.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | read-cache.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/read-cache.c b/read-cache.c index 5e8c06cfd6..c0c2e39ced 100644 --- a/read-cache.c +++ b/read-cache.c @@ -510,6 +510,8 @@ void remove_marked_cache_entries(struct index_state *istate) else ce_array[j++] = ce_array[i]; } + if (j == istate->cache_nr) + return; istate->cache_changed = 1; istate->cache_nr = j; } |