pub struct GitRef {
pub commit_id: String,
pub name: String,
}
Expand description
Information about a specific ref in a git repository, analogous to the information
that git show-ref
produces.
Callers should leverage all the information here for additional safety (for example, using
git update-ref -d <name> <commit_id>
to only delete the reference if it matches the expected
commit ID).
Fields§
§commit_id: String
The hash representing the git commit ID that the ref points to.
name: String
The full ref name, like refs/heads/master
.
Implementations§
source§impl GitRef
impl GitRef
sourcefn parse_char_delimited_line(
line: &str,
delimiter: char,
) -> Result<GitRef, GitRefParseError>
fn parse_char_delimited_line( line: &str, delimiter: char, ) -> Result<GitRef, GitRefParseError>
Utility to parse a <ref_name><delimiter><commit_id>
line that git likes to output
for various commands.
sourcepub fn parse_show_ref_line(line: &str) -> Result<GitRef, GitRefParseError>
pub fn parse_show_ref_line(line: &str) -> Result<GitRef, GitRefParseError>
Parse a single line from git show-ref
as a GitRef
.
sourcepub fn parse_ls_remote_line(line: &str) -> Result<GitRef, GitRefParseError>
pub fn parse_ls_remote_line(line: &str) -> Result<GitRef, GitRefParseError>
Parse a single line from git ls-remote
as a GitRef
.
Trait Implementations§
impl Eq for GitRef
impl StructuralPartialEq for GitRef
Auto Trait Implementations§
impl Freeze for GitRef
impl RefUnwindSafe for GitRef
impl Send for GitRef
impl Sync for GitRef
impl Unpin for GitRef
impl UnwindSafe for GitRef
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)