pub enum Mode {
    NoChangeNeeded,
    FastForward,
    Forced,
    New,
    ImplicitTagNotSentByRemote,
    RejectedSourceObjectNotFound {
        id: ObjectId,
    },
    RejectedTagUpdate,
    RejectedNonFastForward,
    RejectedSymbolic,
    RejectedCurrentlyCheckedOut {
        worktree_dir: PathBuf,
    },
}
Available on crate features async-network-client or blocking-network-client only.
Expand description

Describe the way a ref was updated

Variants§

§

NoChangeNeeded

No change was attempted as the remote ref didn’t change compared to the current ref, or because no remote ref was specified in the ref-spec.

§

FastForward

The old ref’s commit was an ancestor of the new one, allowing for a fast-forward without a merge.

§

Forced

The ref was set to point to the new commit from the remote without taking into consideration its ancestry.

§

New

A new ref has been created as there was none before.

§

ImplicitTagNotSentByRemote

The reference belongs to a tag that was listed by the server but whose target didn’t get sent as it doesn’t point to the commit-graph we were fetching explicitly.

This is kind of update is only happening if remote.<name>.tagOpt is not set explicitly to either --tags or --no-tags.

§

RejectedSourceObjectNotFound

Fields

§id: ObjectId

The id of the object that didn’t exist in the object database, even though it should since it should be part of the pack.

The object id to set the target reference to could not be found.

§

RejectedTagUpdate

Tags can never be overwritten (whether the new object would be a fast-forward or not, or unchanged), unless the refspec specifies force.

§

RejectedNonFastForward

The reference update would not have been a fast-forward, and force is not specified in the ref-spec.

§

RejectedSymbolic

The update of a local symbolic reference was rejected.

§

RejectedCurrentlyCheckedOut

Fields

§worktree_dir: PathBuf

The path to the worktree directory where the branch is checked out.

The update was rejected because the branch is checked out in the given worktree_dir.

Note that the check applies to any known worktree, whether it’s present on disk or not.

Trait Implementations§

source§

impl Clone for Mode

source§

fn clone(&self) -> Mode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Mode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Mode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Mode> for Update

source§

fn from(mode: Mode) -> Self

Converts to this type from the input type.
source§

impl PartialEq<Mode> for Mode

source§

fn eq(&self, other: &Mode) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Mode

source§

impl StructuralEq for Mode

source§

impl StructuralPartialEq for Mode

Auto Trait Implementations§

§

impl RefUnwindSafe for Mode

§

impl Send for Mode

§

impl Sync for Mode

§

impl Unpin for Mode

§

impl UnwindSafe for Mode

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<T> ToCompactString for Twhere T: Display,

§

fn to_compact_string(&self) -> CompactString

Converts the given value to a [CompactString]. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.