Skip to content

Commit 564cd06

Browse files
Merge pull request #4756 from gitbutlerapp/Comments-and-another-enum-correction
Commits and another enum correction
2 parents 99dcf81 + f6dae49 commit 564cd06

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

crates/gitbutler-repo/src/rebase.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ fn commit_conflicted_cherry_result<'repository>(
139139

140140
// If the commit we're rebasing is conflicted, use the commits original base.
141141
let base_tree = if to_rebase.is_conflicted() {
142-
repository.find_real_tree(&to_rebase, ConflictedTreeKey::Ours)?
142+
repository.find_real_tree(&to_rebase, ConflictedTreeKey::Base)?
143143
} else {
144144
let base_commit = to_rebase.parent(0)?;
145145
repository.find_real_tree(&base_commit, Default::default())?

crates/gitbutler-repo/src/repository_ext.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -402,12 +402,14 @@ impl RepositoryExt for git2::Repository {
402402
// we need to do a manual 3-way patch merge
403403
// find the base, which is the parent of to_rebase
404404
let base = if to_rebase.is_conflicted() {
405+
// Use to_rebase's recorded base
405406
self.find_real_tree(to_rebase, ConflictedTreeKey::Base)?
406407
} else {
407408
let base_commit = to_rebase.parent(0)?;
409+
// Use the parent's auto-resolution
408410
self.find_real_tree(&base_commit, Default::default())?
409411
};
410-
// Get the original ours
412+
// Get the auto-resolution
411413
let ours = self.find_real_tree(head, Default::default())?;
412414
// Get the original theirs
413415
let thiers = self.find_real_tree(to_rebase, ConflictedTreeKey::Theirs)?;

0 commit comments

Comments
 (0)