[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
- Apr 28, 2014, 10:55 UTC
- Message-ID
- <1398682553-11634-8-git-send-email-pclouds@gmail.com>
- In-Reply-To
- <1398682553-11634-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 5761b1f..9819363 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