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>
Nguyễn Thái Ngọc Duy committed
Jun 13, 2014 at 19:19 UTC
ad837d9ef9d555ab5077767c8672ff48c6cb562b
1 file changed
+2
read-cache.c
+2
@@ -510,6 +510,8 @@ void remove_marked_cache_entries(struct index_state *istate)
510
else
511
ce_array[j++] = ce_array[i];
512
}
513
+ if (j == istate->cache_nr)
514
+ return;
515
istate->cache_changed = 1;
516
istate->cache_nr = j;
517
}