Skip to content

Commit

Permalink
adapt to changes in gix-merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Nov 22, 2024
1 parent aff76f2 commit 47110d6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions gitoxide-core/src/repository/merge/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::OutputFormat;
use anyhow::{anyhow, bail, Context};
use gix::bstr::BString;
use gix::bstr::ByteSlice;
use gix::merge::tree::UnresolvedConflict;
use gix::merge::tree::TreatAsUnresolved;
use gix::prelude::Write;

use super::tree::Options;
Expand Down Expand Up @@ -48,7 +48,7 @@ pub fn commit(
.merge_commits(ours_id, theirs_id, labels, options.into())?
.tree_merge;
let has_conflicts = res.conflicts.is_empty();
let has_unresolved_conflicts = res.has_unresolved_conflicts(UnresolvedConflict::Renames);
let has_unresolved_conflicts = res.has_unresolved_conflicts(TreatAsUnresolved::Renames);
{
let _span = gix::trace::detail!("Writing merged tree");
let mut written = 0;
Expand Down
4 changes: 2 additions & 2 deletions gitoxide-core/src/repository/merge/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub(super) mod function {
use anyhow::{anyhow, bail, Context};
use gix::bstr::BString;
use gix::bstr::ByteSlice;
use gix::merge::tree::UnresolvedConflict;
use gix::merge::tree::TreatAsUnresolved;
use gix::prelude::Write;

use super::Options;
Expand Down Expand Up @@ -62,7 +62,7 @@ pub(super) mod function {
};
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 has_unresolved_conflicts = res.has_unresolved_conflicts(TreatAsUnresolved::Renames);
{
let _span = gix::trace::detail!("Writing merged tree");
let mut written = 0;
Expand Down
6 changes: 3 additions & 3 deletions gix/src/merge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub mod commit {
///
pub mod tree {
use gix_merge::blob::builtin_driver;
pub use gix_merge::tree::{Conflict, ContentMerge, Resolution, ResolutionFailure, UnresolvedConflict};
pub use gix_merge::tree::{Conflict, ContentMerge, Resolution, ResolutionFailure, TreatAsUnresolved};

/// The outcome produced by [`Repository::merge_trees()`](crate::Repository::merge_trees()).
#[derive(Clone)]
Expand All @@ -130,7 +130,7 @@ pub mod tree {
impl Outcome<'_> {
/// Return `true` if there is any conflict that would still need to be resolved as they would yield undesirable trees.
/// This is based on `how` to determine what should be considered unresolved.
pub fn has_unresolved_conflicts(&self, how: UnresolvedConflict) -> bool {
pub fn has_unresolved_conflicts(&self, how: TreatAsUnresolved) -> bool {
self.conflicts.iter().any(|c| c.is_unresolved(how))
}
}
Expand Down Expand Up @@ -206,7 +206,7 @@ pub mod tree {
/// If `Some(what-is-unresolved)`, the first unresolved conflict will cause the entire merge to stop.
/// This is useful to see if there is any conflict, without performing the whole operation, something
/// that can be very relevant during merges that would cause a lot of blob-diffs.
pub fn with_fail_on_conflict(mut self, fail_on_conflict: Option<UnresolvedConflict>) -> Self {
pub fn with_fail_on_conflict(mut self, fail_on_conflict: Option<TreatAsUnresolved>) -> Self {
self.inner.fail_on_conflict = fail_on_conflict;
self
}
Expand Down

0 comments on commit 47110d6

Please sign in to comment.