Skip to main content

BranchCommitRefUpdate

Struct BranchCommitRefUpdate 

Source
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 str

Branch 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: ObjectId

New commit OID for the branch tip.

§identity: &'a str

Committer identity for reflog lines.

§reflog_message: &'a str

Reflog message (without trailing newline).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.