reuse the commit-graph between runs

This time, it contains whole commits and only flags are reset
between runs. With this amount of re-use, it will manage
to rival `git2`.
This commit is contained in:
Sebastian Thiel 2024-08-27 11:25:47 +02:00
parent c2decbbdc7
commit 06edec70cb
No known key found for this signature in database
GPG Key ID: 9CB5EE7895E8268B

View File

@ -517,13 +517,14 @@ pub fn get_branch_listing_details(
let mut repo = repo.to_thread_local();
repo.object_cache_size_if_unset(50 * 1024 * 1024);
let cache = repo.commit_graph_if_enabled()?;
let mut graph = repo.revision_graph(cache.as_ref());
for (other_branch_commit_id, branch_head) in all_other_branch_commit_ids {
let branch_head = git2_to_gix_object_id(branch_head);
let base = repo
.merge_base_with_cache(
.merge_base_with_graph(
git2_to_gix_object_id(other_branch_commit_id),
branch_head,
cache.as_ref(),
&mut graph,
)
.ok()
.map(gix::Id::detach);