summaryrefslogtreecommitdiff
path: root/src/index.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@elego.de>2011-08-02 14:38:49 +0200
committerVicent Marti <tanoku@gmail.com>2011-09-27 14:33:18 +0200
commitb419fe2d8cd536e596a4e0ea2eac221fbc2f59a1 (patch)
treea3c8a7a87503c5971025763f34b9ce44f8706dec /src/index.c
parente23ede0de599feaabf52cbac89f04b5293a9c4bc (diff)
downloadlibgit2-b419fe2d8cd536e596a4e0ea2eac221fbc2f59a1.tar.gz
Invalidate the path when removing from the index
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Diffstat (limited to 'src/index.c')
-rw-r--r--src/index.c6
1 files changed, 6 insertions, 0 deletions
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);
}