Skip to content

Commit

Permalink
Merge pull request #7379 from gitbutlerapp/update-stack-branch-refere…
Browse files Browse the repository at this point in the history
…nce-handling

Fix: when updating references it's okay if an existing reference doesnt match the existing value
  • Loading branch information
krlvi authored Feb 24, 2025
2 parents 8f78746 + 857fa80 commit 3c6a251
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions crates/gitbutler-stack/src/stack_branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,10 @@ impl StackBranch {
CommitOrChangeId::CommitId(id) => gix::ObjectId::from_str(id)?,
CommitOrChangeId::ChangeId(_) => return Ok(None), // noop
};
let old_oid: gix::ObjectId = match self.head.clone() {
CommitOrChangeId::CommitId(id) => gix::ObjectId::from_str(&id)?,
CommitOrChangeId::ChangeId(_) => return Ok(None), // noop
};
let reference = repo.reference(
qualified_reference_name(self.name()),
new_oid,
PreviousValue::ExistingMustMatch(old_oid.into()),
PreviousValue::Any,
"GitButler reference",
)?;
Ok(Some(reference.name().as_bstr().to_owned()))
Expand Down

0 comments on commit 3c6a251

Please sign in to comment.