pub struct BranchCommitRefUpdate<'a> {
pub branch_ref: &'a str,
pub expected_old: Option<ObjectId>,
pub new_oid: ObjectId,
pub identity: &'a str,
pub reflog_message: &'a str,
}Expand description
Move a checked-out branch to new_oid and append matching branch and HEAD reflogs.
Verifies HEAD is a symbolic ref to branch_ref, then runs a storage transaction:
on the files backend the branch ref lock is held from CAS through reflog writes and
ref commit; on reftable, branch and HEAD logs are written in one transaction.
Reflog failures before the ref commit do not advance the branch tip.
§Errors
Returns Error::Message when HEAD does not point at branch_ref,
store::RefStoreError::ExpectedMismatch (see verify_branch_commit_cas) when the
CAS check fails, or an I/O error when ref/reflog writes fail.
Fields§
§branch_ref: &'a strBranch ref to update (e.g. refs/heads/main).
expected_old: Option<ObjectId>Expected current tip; None when the branch must not exist yet (unborn).
new_oid: ObjectIdNew commit OID for the branch tip.
identity: &'a strCommitter identity for reflog lines.
reflog_message: &'a strReflog message (without trailing newline).