pub struct Repo { /* private fields */ }Expand description
A discovered git repository.
Implementations§
Source§impl Repo
impl Repo
Sourcepub fn discover(path: &Path) -> Result<Self, GitError>
pub fn discover(path: &Path) -> Result<Self, GitError>
Discover the repository containing path (walking upwards to the .git).
§Errors
Returns GitError::Git if no repository is found or it cannot be opened.
Sourcepub fn common_dir(&self) -> &Path
pub fn common_dir(&self) -> &Path
The repository’s common git directory. The cache lives under here so it is shared across linked worktrees (which each have their own git dir).
Sourcepub fn git_dir(&self) -> &Path
pub fn git_dir(&self) -> &Path
This worktree’s git directory (per-worktree; the graph DB lives here).
Sourcepub fn head_tree_id(&self) -> Result<String, GitError>
pub fn head_tree_id(&self) -> Result<String, GitError>
Hex object id of the tree at HEAD.
§Errors
Returns GitError::Git if HEAD cannot be resolved to a tree.
Auto Trait Implementations§
impl !Freeze for Repo
impl !RefUnwindSafe for Repo
impl !Send for Repo
impl !Sync for Repo
impl !UnwindSafe for Repo
impl Unpin for Repo
impl UnsafeUnpin for Repo
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