Merge pull request #4756 from gitbutlerapp/Comments-and-another-enum-correction

Commits and another enum correction
This commit is contained in:
Caleb Owens 2024-08-26 15:45:45 +02:00 committed by GitHub
commit 564cd06666
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -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())?

View File

@ -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)?;