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>
This commit is contained in:
Nguyễn Thái Ngọc Duy 2014-06-13 19:19:26 +07:00 коммит произвёл Junio C Hamano
Родитель ce51bf09f8
Коммит ad837d9ef9
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -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;
}