pub struct GitTracker {
pub repository: Repository,
pub allow_insecure: bool,
}Fields§
§repository: Repository§allow_insecure: boolImplementations§
Source§impl GitTracker
impl GitTracker
Sourcepub fn open(path: impl AsRef<Path>, allow_insecure: bool) -> Result<Self>
pub fn open(path: impl AsRef<Path>, allow_insecure: bool) -> Result<Self>
Opens an existing repository at the given path
Sourcepub fn stage_files(&self, files: &[PathBuf]) -> Result<()>
pub fn stage_files(&self, files: &[PathBuf]) -> Result<()>
Stages only the specified files in the repository
Sourcepub fn create_commit(&self, message: &str) -> Result<Oid>
pub fn create_commit(&self, message: &str) -> Result<Oid>
Creates a commit with the given message
Sourcepub fn create_tag(&self, tag_name: &str, commit_id: Oid) -> Result<()>
pub fn create_tag(&self, tag_name: &str, commit_id: Oid) -> Result<()>
Creates a tag for the given commit
Sourcepub fn push_commits(&self, remote_name: &str, branch: &str) -> Result<()>
pub fn push_commits(&self, remote_name: &str, branch: &str) -> Result<()>
Pushes commits to the remote
Sourcepub fn push_tag(&self, remote_name: &str, tag_name: &str) -> Result<()>
pub fn push_tag(&self, remote_name: &str, tag_name: &str) -> Result<()>
Pushes a tag to the remote
Sourcepub fn current_branch(&self) -> Result<String>
pub fn current_branch(&self) -> Result<String>
Gets the current branch name
Sourcepub fn execute_git_mode(
&self,
mode: GitMode,
version: &str,
files: &[PathBuf],
) -> Result<()>
pub fn execute_git_mode( &self, mode: GitMode, version: &str, files: &[PathBuf], ) -> Result<()>
Executes git operations based on the GitMode and version
Fetches tags from the remote
Gets all tags from the repository
Auto Trait Implementations§
impl Freeze for GitTracker
impl RefUnwindSafe for GitTracker
impl Send for GitTracker
impl !Sync for GitTracker
impl Unpin for GitTracker
impl UnwindSafe for GitTracker
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