mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-23 17:43:47 +03:00
fixes a situation in which listing of snapshots fails
This commit is contained in:
parent
ea5079b723
commit
0e9b8c2957
@ -867,10 +867,23 @@ fn tree_from_applied_vbranches(
|
|||||||
|
|
||||||
for branch in applied_branch_trees {
|
for branch in applied_branch_trees {
|
||||||
let branch_tree = repo.find_tree(branch)?;
|
let branch_tree = repo.find_tree(branch)?;
|
||||||
let mut workdir_temp_index =
|
let mut merge_options: git2::MergeOptions = git2::MergeOptions::new();
|
||||||
repo.merge_trees(&base_tree, ¤t_ours, &branch_tree, None)?;
|
merge_options.fail_on_conflict(false);
|
||||||
workdir_tree_id = workdir_temp_index.write_tree_to(repo)?;
|
let mut workdir_temp_index = repo.merge_trees(
|
||||||
current_ours = repo.find_tree(workdir_tree_id)?;
|
&base_tree,
|
||||||
|
¤t_ours,
|
||||||
|
&branch_tree,
|
||||||
|
Some(&merge_options),
|
||||||
|
)?;
|
||||||
|
match workdir_temp_index.write_tree_to(repo) {
|
||||||
|
Ok(id) => {
|
||||||
|
workdir_tree_id = id;
|
||||||
|
current_ours = repo.find_tree(workdir_tree_id)?;
|
||||||
|
}
|
||||||
|
Err(_err) => {
|
||||||
|
tracing::warn!("Failed to merge tree {branch} - this branch is probably applied at a time when it should not be");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(workdir_tree_id)
|
Ok(workdir_tree_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user