mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-09 18:22:16 +00:00
index: invalidate added paths
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 <cmn@elego.de>
This commit is contained in:
parent
69bffab969
commit
e23ede0de5
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user