pub struct CommitRef { /* private fields */ }
Expand description
Bookmark or tag name with metadata.
Implementations§
Source§impl CommitRef
impl CommitRef
Sourcepub fn local<'a>(
name: impl Into<String>,
target: RefTarget,
remote_refs: impl IntoIterator<Item = &'a RemoteRef>,
) -> Rc<Self>
pub fn local<'a>( name: impl Into<String>, target: RefTarget, remote_refs: impl IntoIterator<Item = &'a RemoteRef>, ) -> Rc<Self>
Creates local ref representation which might track some of the
remote_refs
.
Sourcepub fn local_only(name: impl Into<String>, target: RefTarget) -> Rc<Self>
pub fn local_only(name: impl Into<String>, target: RefTarget) -> Rc<Self>
Creates local ref representation which doesn’t track any remote refs.
Sourcepub fn remote(
name: impl Into<String>,
remote_name: impl Into<String>,
remote_ref: RemoteRef,
local_target: &RefTarget,
) -> Rc<Self>
pub fn remote( name: impl Into<String>, remote_name: impl Into<String>, remote_ref: RemoteRef, local_target: &RefTarget, ) -> Rc<Self>
Creates remote ref representation which might be tracked by a local ref
pointing to the local_target
.
Sourcepub fn remote_only(
name: impl Into<String>,
remote_name: impl Into<String>,
target: RefTarget,
) -> Rc<Self>
pub fn remote_only( name: impl Into<String>, remote_name: impl Into<String>, target: RefTarget, ) -> Rc<Self>
Creates remote ref representation which isn’t tracked by a local ref.
Sourcepub fn remote_name(&self) -> Option<&str>
pub fn remote_name(&self) -> Option<&str>
Remote name if this is a remote or Git-tracking ref.
Sourcepub fn is_present(&self) -> bool
pub fn is_present(&self) -> bool
Returns true if this ref points to any commit.
Sourcepub fn has_conflict(&self) -> bool
pub fn has_conflict(&self) -> bool
Whether the ref target has conflicts.
Sourcepub fn is_tracked(&self) -> bool
pub fn is_tracked(&self) -> bool
Returns true if this ref is tracked by a local ref. The local ref might have been deleted (but not pushed yet.)
Sourcepub fn is_tracking_present(&self) -> bool
pub fn is_tracking_present(&self) -> bool
Returns true if this ref is tracked by a local ref, and if the local ref is present.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CommitRef
impl RefUnwindSafe for CommitRef
impl Send for CommitRef
impl !Sync for CommitRef
impl Unpin for CommitRef
impl UnwindSafe for CommitRef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more