diff --git a/crates/gitbutler-repo/src/rebase.rs b/crates/gitbutler-repo/src/rebase.rs index 26f24a0cd..0a4b7f648 100644 --- a/crates/gitbutler-repo/src/rebase.rs +++ b/crates/gitbutler-repo/src/rebase.rs @@ -139,7 +139,7 @@ fn commit_conflicted_cherry_result<'repository>( // If the commit we're rebasing is conflicted, use the commits original base. let base_tree = if to_rebase.is_conflicted() { - repository.find_real_tree(&to_rebase, ConflictedTreeKey::Ours)? + repository.find_real_tree(&to_rebase, ConflictedTreeKey::Base)? } else { let base_commit = to_rebase.parent(0)?; repository.find_real_tree(&base_commit, Default::default())? diff --git a/crates/gitbutler-repo/src/repository_ext.rs b/crates/gitbutler-repo/src/repository_ext.rs index 98f2ffcd0..eb2efdfa1 100644 --- a/crates/gitbutler-repo/src/repository_ext.rs +++ b/crates/gitbutler-repo/src/repository_ext.rs @@ -402,12 +402,14 @@ impl RepositoryExt for git2::Repository { // we need to do a manual 3-way patch merge // find the base, which is the parent of to_rebase let base = if to_rebase.is_conflicted() { + // Use to_rebase's recorded base self.find_real_tree(to_rebase, ConflictedTreeKey::Base)? } else { let base_commit = to_rebase.parent(0)?; + // Use the parent's auto-resolution self.find_real_tree(&base_commit, Default::default())? }; - // Get the original ours + // Get the auto-resolution let ours = self.find_real_tree(head, Default::default())?; // Get the original theirs let thiers = self.find_real_tree(to_rebase, ConflictedTreeKey::Theirs)?;