Skip to content

Commit be950b1

Browse files
committed
Fixes a bug where incorrect remote commits are shown when remote was rebased
1 parent e7e8ffd commit be950b1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/gitbutler-stack/src/stack.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,10 @@ impl Stack {
530530
let head_commit = repo
531531
.find_reference(&head.remote_reference(&remote_name)?)?
532532
.peel_to_commit()?;
533-
let merge_base = repo.merge_base(head_commit.id(), default_target.sha)?;
533+
let target_commit = repo
534+
.find_reference(default_target.branch.to_string().as_str())?
535+
.peel_to_commit()?;
536+
let merge_base = repo.merge_base(head_commit.id(), target_commit.id())?;
534537
repo.log(head_commit.id(), LogUntil::Commit(merge_base), false)?
535538
.into_iter()
536539
.rev()

0 commit comments

Comments
 (0)