mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-02 22:54:15 +00:00
index_read_index: invalidate new paths in tree cache
When adding a new entry to an existing index via `git_index_read_index`, be sure to remove the tree cache entry for that new path. This will mark all parent trees as dirty.
This commit is contained in:
parent
5acf18ac63
commit
46082c384f
@ -3004,6 +3004,12 @@ int git_index_read_index(
|
||||
((struct entry_internal *)add_entry)->pathlen);
|
||||
}
|
||||
|
||||
/* invalidate this path in the tree cache if this is new (to
|
||||
* invalidate the parent trees)
|
||||
*/
|
||||
if (dup_entry && !remove_entry && index->tree)
|
||||
git_tree_cache_invalidate_path(index->tree, dup_entry->path);
|
||||
|
||||
if (add_entry) {
|
||||
if ((error = git_vector_insert(&new_entries, add_entry)) == 0)
|
||||
INSERT_IN_MAP_EX(index, new_entries_map, add_entry, error);
|
||||
|
Loading…
Reference in New Issue
Block a user