pub struct Repo { /* private fields */ }Implementations§
Source§impl Repo
impl Repo
Sourcepub fn discover(from: &Path) -> Option<Self>
pub fn discover(from: &Path) -> Option<Self>
Discover the repository containing path (buffer path or cwd).
pub fn workdir(&self) -> &Path
Sourcepub fn remotes(&self) -> Vec<(String, String)>
pub fn remotes(&self) -> Vec<(String, String)>
Remotes as (name, url) pairs — libgit2 config, no spawn.
Sourcepub fn head_sha(&self) -> Option<String>
pub fn head_sha(&self) -> Option<String>
HEAD’s full SHA (permalink base — branch always resolves to SHA).
Sourcepub fn head_branch(&self) -> Option<String>
pub fn head_branch(&self) -> Option<String>
Current branch (short name; detached HEAD gives the sha prefix).
Sourcepub fn head_content(&self, path: &Path) -> Option<String>
pub fn head_content(&self, path: &Path) -> Option<String>
HEAD’s content for path, if tracked.
Sourcepub fn hunks(&self, path: &Path, content: &str) -> Vec<Hunk>
pub fn hunks(&self, path: &Path, content: &str) -> Vec<Hunk>
Hunks between HEAD and content for path. Untracked files
report a single all-Add hunk.
Auto Trait Implementations§
impl !Sync for Repo
impl Freeze for Repo
impl RefUnwindSafe for Repo
impl Send for Repo
impl Unpin for Repo
impl UnsafeUnpin for Repo
impl UnwindSafe 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