From b419fe2d8cd536e596a4e0ea2eac221fbc2f59a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Tue, 2 Aug 2011 14:38:49 +0200 Subject: [PATCH] Invalidate the path when removing from the index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Carlos Martín Nieto --- src/index.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/index.c b/src/index.c index 34f7d05fa..c7bf1a859 100644 --- a/src/index.c +++ b/src/index.c @@ -490,7 +490,13 @@ int git_index_append2(git_index *index, const git_index_entry *source_entry) int git_index_remove(git_index *index, int position) { + git_index_entry *entry; + git_vector_sort(&index->entries); + entry = git_vector_get(&index->entries, position); + if (entry != NULL) + git_tree_cache_invalidate_path(index->tree, entry->path); + return git_vector_remove(&index->entries, (unsigned int)position); }