Merge pull request #5386 from gitbutlerapp/kv-branch-1

Fixes a bug where incorrect remote commits are shown when remote was rebased
This commit is contained in:
Kiril Videlov 2024-11-03 00:33:17 +01:00 committed by GitHub
commit 3a383e19bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -574,7 +574,10 @@ impl Stack {
let head_commit = repo
.find_reference(&head.remote_reference(&remote_name)?)?
.peel_to_commit()?;
let merge_base = repo.merge_base(head_commit.id(), default_target.sha)?;
let target_commit = repo
.find_reference(default_target.branch.to_string().as_str())?
.peel_to_commit()?;
let merge_base = repo.merge_base(head_commit.id(), target_commit.id())?;
repo.log(head_commit.id(), LogUntil::Commit(merge_base), false)?
.into_iter()
.rev()