[PATCH 07/32] read-cache: be strict about "changed" in remove_marked_cache_entries()
- From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
- Date
- Jun 13, 2014, 12:19 UTC
- Message-ID
- <1402661991-14977-8-git-send-email-pclouds@gmail.com>
- In-Reply-To
- <1402661991-14977-1-git-send-email-pclouds@gmail.com>
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> --- read-cache.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/read-cache.c b/read-cache.c index 5e8c06c..c0c2e39 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; }
-- 1.9.1.346.ga2b5940