pub struct GitBackend;Expand description
Git-backed VCS implementation.
Implementations§
Source§impl GitBackend
impl GitBackend
Trait Implementations§
Source§impl Debug for GitBackend
impl Debug for GitBackend
Source§impl Default for GitBackend
impl Default for GitBackend
Source§fn default() -> GitBackend
fn default() -> GitBackend
Returns the “default value” for a type. Read more
Source§impl VcsBackend for GitBackend
impl VcsBackend for GitBackend
Source§fn init(&self, path: &Path) -> Result<(), NapError>
fn init(&self, path: &Path) -> Result<(), NapError>
Initialize a new repository at the given path.
Source§fn commit(
&self,
path: &Path,
message: &str,
author: &str,
) -> Result<String, NapError>
fn commit( &self, path: &Path, message: &str, author: &str, ) -> Result<String, NapError>
Stage all files and create a commit.
Source§fn read_file_at_ref(
&self,
repo_path: &Path,
file_path: &str,
reference: Option<&str>,
) -> Result<String, NapError>
fn read_file_at_ref( &self, repo_path: &Path, file_path: &str, reference: Option<&str>, ) -> Result<String, NapError>
Read a file’s content at a specific ref (branch, tag, or commit hash).
If
reference is None, reads from the current working tree.Source§fn log(
&self,
path: &Path,
file: Option<&str>,
limit: usize,
) -> Result<Vec<CommitInfo>, NapError>
fn log( &self, path: &Path, file: Option<&str>, limit: usize, ) -> Result<Vec<CommitInfo>, NapError>
Get the commit log for the repository, optionally filtered to a specific file.
Source§fn create_tag(&self, path: &Path, name: &str) -> Result<(), NapError>
fn create_tag(&self, path: &Path, name: &str) -> Result<(), NapError>
Create a tag at the current HEAD.
Source§fn current_branch(&self, path: &Path) -> Result<String, NapError>
fn current_branch(&self, path: &Path) -> Result<String, NapError>
Get the current branch name.
Source§fn resolve_branch_head(
&self,
path: &Path,
branch: &str,
) -> Result<String, NapError>
fn resolve_branch_head( &self, path: &Path, branch: &str, ) -> Result<String, NapError>
Resolve the most recent commit hash on a given branch. Read more
List all tags.
Source§fn add_remote(&self, path: &Path, name: &str, url: &str) -> Result<(), NapError>
fn add_remote(&self, path: &Path, name: &str, url: &str) -> Result<(), NapError>
Add a remote.
Source§fn list_remotes(&self, path: &Path) -> Result<Vec<(String, String)>, NapError>
fn list_remotes(&self, path: &Path) -> Result<Vec<(String, String)>, NapError>
List remotes as
(name, url) pairs.Source§fn push(
&self,
path: &Path,
remote: Option<&str>,
branch: Option<&str>,
) -> Result<(), NapError>
fn push( &self, path: &Path, remote: Option<&str>, branch: Option<&str>, ) -> Result<(), NapError>
Push the current branch to its upstream / a named remote.
Auto Trait Implementations§
impl Freeze for GitBackend
impl RefUnwindSafe for GitBackend
impl Send for GitBackend
impl Sync for GitBackend
impl Unpin for GitBackend
impl UnsafeUnpin for GitBackend
impl UnwindSafe for GitBackend
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request