pub struct GitAdapter { /* private fields */ }Expand description
Git adapter implementation
Implementations§
Source§impl GitAdapter
impl GitAdapter
Sourcepub fn open(config: GitAdapterConfig) -> Result<Self, ScmError>
pub fn open(config: GitAdapterConfig) -> Result<Self, ScmError>
Open a Git repository at the given path or current directory
§Errors
Returns ScmError if the repository cannot be discovered or opened
Sourcepub fn repository(&self) -> Arc<Mutex<Repository>>
pub fn repository(&self) -> Arc<Mutex<Repository>>
Get the underlying git2 repository
Trait Implementations§
Source§impl SourceControl for GitAdapter
impl SourceControl for GitAdapter
Source§fn get_commits_since<'life0, 'life1, 'async_trait>(
&'life0 self,
tag: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Commit>, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_commits_since<'life0, 'life1, 'async_trait>(
&'life0 self,
tag: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Commit>, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get commits since a specific tag/ref Read more
Source§fn get_last_tag<'life0, 'life1, 'async_trait>(
&'life0 self,
pattern: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_last_tag<'life0, 'life1, 'async_trait>(
&'life0 self,
pattern: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the last tag matching a pattern Read more
Source§fn create_tag<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
message: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_tag<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
message: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a new tag Read more
Source§fn delete_tag<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_tag<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a tag Read more
Source§fn get_current_commit<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_current_commit<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get current commit hash Read more
Source§fn get_current_branch<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_current_branch<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get current branch name Read more
Source§fn get_working_tree_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<WorkingTreeStatus, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_working_tree_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<WorkingTreeStatus, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if working tree is clean Read more
Source§fn commit<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
message: &'life1 str,
files: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn commit<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
message: &'life1 str,
files: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<String, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a commit with staged changes Read more
Source§fn stage_files<'life0, 'life1, 'async_trait>(
&'life0 self,
files: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<(), ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stage_files<'life0, 'life1, 'async_trait>(
&'life0 self,
files: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<(), ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stage files for commit Read more
Source§fn push<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
remote: Option<&'life1 str>,
branch: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<(), ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn push<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
remote: Option<&'life1 str>,
branch: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<(), ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Push to remote Read more
Source§fn repository_root(&self) -> Option<&Path>
fn repository_root(&self) -> Option<&Path>
Get repository root path
Source§fn is_on_branch<'life0, 'life1, 'async_trait>(
&'life0 self,
branch: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_on_branch<'life0, 'life1, 'async_trait>(
&'life0 self,
branch: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, ScmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if we’re on a specific branch
Get tags for a specific commit Read more
Auto Trait Implementations§
impl Freeze for GitAdapter
impl RefUnwindSafe for GitAdapter
impl Send for GitAdapter
impl Sync for GitAdapter
impl Unpin for GitAdapter
impl UnsafeUnpin for GitAdapter
impl UnwindSafe for GitAdapter
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