Skip to content

Commit

Permalink
adapt to changes in gix
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Nov 5, 2024
1 parent f158ca0 commit fab342c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions gitoxide-core/src/repository/merge/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,15 @@ pub(super) mod function {
.map_or(theirs_id_str.as_str().into(), |n| n.as_bstr())
.into(),
};
let mut res = repo.merge_trees(base_id, ours_id, theirs_id, labels, options)?;
let res = repo.merge_trees(base_id, ours_id, theirs_id, labels, options)?;
let has_conflicts = res.conflicts.is_empty();
let has_unresolved_conflicts = res.has_unresolved_conflicts(UnresolvedConflict::Renames);
{
let _span = gix::trace::detail!("Writing merged tree");
let mut written = 0;
let tree_id = res
.tree
.detach()
.write(|tree| {
written += 1;
repo.write(tree)
Expand All @@ -86,10 +89,10 @@ pub(super) mod function {
writeln!(out, "{tree_id} (wrote {written} trees)")?;
}

if !res.conflicts.is_empty() {
if !has_conflicts {
writeln!(err, "{} possibly resolved conflicts", res.conflicts.len())?;
}
if res.has_unresolved_conflicts(UnresolvedConflict::Renames) {
if has_unresolved_conflicts {
bail!("Tree conflicted")
}
Ok(())
Expand Down

0 comments on commit fab342c

Please sign in to comment.