mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-09 22:39:38 +00:00
Avoid retaining / releasing the index more than necessary when GIT_DIFF_UPDATE_INDEX is enabled
This commit is contained in:
parent
15f581747c
commit
8a3934e49b
@ -620,10 +620,9 @@ int git_diff__oid_for_entry(
|
|||||||
if (!error && update_match && git_oid_equal(out, update_match)) {
|
if (!error && update_match && git_oid_equal(out, update_match)) {
|
||||||
git_index *idx;
|
git_index *idx;
|
||||||
|
|
||||||
if (!(error = git_repository_index(&idx, diff->repo))) {
|
if (!(error = git_repository_index__weakptr(&idx, diff->repo))) {
|
||||||
memcpy(&entry.id, out, sizeof(entry.id));
|
memcpy(&entry.id, out, sizeof(entry.id));
|
||||||
error = git_index_add(idx, &entry);
|
error = git_index_add(idx, &entry);
|
||||||
git_index_free(idx);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user