mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-18 23:02:31 +03:00
Fixes a bug when validating stack target commit
This commit is contained in:
parent
1aa47d00f2
commit
915acd6afb
@ -591,9 +591,14 @@ fn commit_by_branch_id_and_change_id<'a>(
|
||||
) -> Result<git2::Commit<'a>> {
|
||||
// Find the commit with the change id
|
||||
let merge_base = ctx.repository().merge_base(stack_head, target_sha)?;
|
||||
let commit = ctx
|
||||
.repository()
|
||||
.log(stack_head, LogUntil::Commit(merge_base))?
|
||||
|
||||
let commits = if stack_head == merge_base {
|
||||
vec![ctx.repository().find_commit(stack_head)?]
|
||||
} else {
|
||||
ctx.repository()
|
||||
.log(stack_head, LogUntil::Commit(merge_base))?
|
||||
};
|
||||
let commit = commits
|
||||
.iter()
|
||||
.map(|c| c.id())
|
||||
.find(|c| {
|
||||
|
Loading…
Reference in New Issue
Block a user