pub struct RefStore { /* private fields */ }Expand description
Thread-safe reference store.
Implementations§
Source§impl RefStore
impl RefStore
Sourcepub fn set_symbolic(&self, name: &str, target: &str)
pub fn set_symbolic(&self, name: &str, target: &str)
Sets a symbolic reference.
Sourcepub fn list(&self, prefix: &str) -> Vec<(String, Reference)>
pub fn list(&self, prefix: &str) -> Vec<(String, Reference)>
Lists all references with a given prefix.
Sourcepub fn resolve_head(&self) -> Result<ObjectId>
pub fn resolve_head(&self) -> Result<ObjectId>
Resolves HEAD to find the current branch and commit.
Sourcepub fn current_branch(&self) -> Option<String>
pub fn current_branch(&self) -> Option<String>
Gets the current branch name (if HEAD is symbolic).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RefStore
impl !RefUnwindSafe for RefStore
impl Send for RefStore
impl Sync for RefStore
impl Unpin for RefStore
impl UnwindSafe for RefStore
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