Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-06-13 16:19:26 +0400
committerJunio C Hamano <gitster@pobox.com>2014-06-13 22:49:38 +0400
commitad837d9ef9d555ab5077767c8672ff48c6cb562b (patch)
treebcc4182a6bc56281727669cd245341fc1985d665 /read-cache.c
parentce51bf09f8f0de70673b7cbdbc0e0df0b07e1def (diff)
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>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c2
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;
}