pub struct Repository { /* private fields */ }
Expand description
A light cloneable, simple wrapper around the git2::Repository
struct
Implementations§
Source§impl Repository
impl Repository
Sourcepub fn open_from_env() -> Result<Self, GitError>
pub fn open_from_env() -> Result<Self, GitError>
Find and open an existing repository, respecting git environment variables. This will check
for and use $GIT_DIR
, and if unset will search for a repository starting in the current
directory, walking to the root.
§Errors
Will result in an error if the repository cannot be opened.
Sourcepub fn open_from_path(path: &Path) -> Result<Self, GitError>
pub fn open_from_path(path: &Path) -> Result<Self, GitError>
Attempt to open an already-existing repository at path
.
§Errors
Will result in an error if the repository cannot be opened.
Sourcepub fn load_config(&self) -> Result<Config, GitError>
pub fn load_config(&self) -> Result<Config, GitError>
Load the git configuration for the repository.
§Errors
Will result in an error if the configuration is invalid.
Sourcepub fn load_commit_diff(
&self,
hash: &str,
config: &CommitDiffLoaderOptions,
) -> Result<CommitDiff, GitError>
pub fn load_commit_diff( &self, hash: &str, config: &CommitDiffLoaderOptions, ) -> Result<CommitDiff, GitError>
Trait Implementations§
Source§impl Clone for Repository
impl Clone for Repository
Source§fn clone(&self) -> Repository
fn clone(&self) -> Repository
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Repository
impl Debug for Repository
Source§impl From<Repository> for Repository
impl From<Repository> for Repository
Source§fn from(repository: Repository) -> Self
fn from(repository: Repository) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Repository
impl !RefUnwindSafe for Repository
impl Send for Repository
impl Sync for Repository
impl Unpin for Repository
impl !UnwindSafe for Repository
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