mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-19 07:32:22 +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>> {
|
) -> Result<git2::Commit<'a>> {
|
||||||
// Find the commit with the change id
|
// Find the commit with the change id
|
||||||
let merge_base = ctx.repository().merge_base(stack_head, target_sha)?;
|
let merge_base = ctx.repository().merge_base(stack_head, target_sha)?;
|
||||||
let commit = ctx
|
|
||||||
.repository()
|
let commits = if stack_head == merge_base {
|
||||||
|
vec![ctx.repository().find_commit(stack_head)?]
|
||||||
|
} else {
|
||||||
|
ctx.repository()
|
||||||
.log(stack_head, LogUntil::Commit(merge_base))?
|
.log(stack_head, LogUntil::Commit(merge_base))?
|
||||||
|
};
|
||||||
|
let commit = commits
|
||||||
.iter()
|
.iter()
|
||||||
.map(|c| c.id())
|
.map(|c| c.id())
|
||||||
.find(|c| {
|
.find(|c| {
|
||||||
|
Loading…
Reference in New Issue
Block a user