From e23ede0de599feaabf52cbac89f04b5293a9c4bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Tue, 26 Jul 2011 15:22:15 +0200 Subject: [PATCH] index: invalidate added paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a file is updated in the index, it's path needs to be invalidated in the tree cache as the hash is no longer correct. Signed-off-by: Carlos Martín Nieto --- src/index.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.c b/src/index.c index 905e9c522..34f7d05fa 100644 --- a/src/index.c +++ b/src/index.c @@ -436,6 +436,8 @@ static int index_add(git_index *index, const char *path, int stage, int replace) if (ret) goto err; + git_tree_cache_invalidate_path(index->tree, entry->path); + return ret; err: index_entry_free(entry); @@ -468,6 +470,8 @@ static int index_add2(git_index *index, const git_index_entry *source_entry, if (ret) goto err; + git_tree_cache_invalidate_path(index->tree, entry->path); + return ret; err: index_entry_free(entry);