summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/index.c4
1 files changed, 4 insertions, 0 deletions
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);