pub struct SystemGit {
credentials: Option<RemoteCredentials>,
}Expand description
Production Git adapter backed by libgit2.
Fields§
§credentials: Option<RemoteCredentials>Implementations§
Source§impl SystemGit
impl SystemGit
Sourcepub const fn authenticated(credentials: RemoteCredentials) -> Self
pub const fn authenticated(credentials: RemoteCredentials) -> Self
An adapter that answers HTTPS authentication requests with
credentials.
Sourcefn proxy() -> ProxyOptions<'static>
fn proxy() -> ProxyOptions<'static>
Proxy settings taken from the Git configuration and environment, as
the git command line uses them.
fn open(path: &Path) -> Result<Repository, GitError>
Sourcefn commit<'r>(repo: &'r Repository, rev: &str) -> Result<Commit<'r>, Git2Error>
fn commit<'r>(repo: &'r Repository, rev: &str) -> Result<Commit<'r>, Git2Error>
The commit a revision expression names.
fn origin(repo: &Repository) -> Result<Remote<'_>, GitError>
Sourcefn worktree_name(path: &Path) -> String
fn worktree_name(path: &Path) -> String
The worktree and private branch name for a worktree directory, derived from its path so that removal finds what creation registered.
Sourcefn callbacks(&self) -> RemoteCallbacks<'_>
fn callbacks(&self) -> RemoteCallbacks<'_>
Callbacks that offer the configured credential once per connection, so a rejected token fails instead of being retried forever.
Trait Implementations§
Source§impl GitCommands for SystemGit
impl GitCommands for SystemGit
Source§impl GitHistory for SystemGit
impl GitHistory for SystemGit
List the tag names that start with
prefix.Source§fn resolve(&self, repository: &Path, rev: &str) -> Result<String, Self::Error>
fn resolve(&self, repository: &Path, rev: &str) -> Result<String, Self::Error>
The commit a revision expression such as
origin/main names.Source§fn has_changes(
&self,
repository: &Path,
from: Option<&str>,
to: &str,
scope: UnitScope<'_>,
) -> Result<bool, Self::Error>
fn has_changes( &self, repository: &Path, from: Option<&str>, to: &str, scope: UnitScope<'_>, ) -> Result<bool, Self::Error>
Whether
scope differs between the commits from and to. Without
from the comparison starts from the empty tree.Source§fn commit_messages(
&self,
repository: &Path,
from: Option<&str>,
to: &str,
scope: UnitScope<'_>,
) -> Result<Vec<String>, Self::Error>
fn commit_messages( &self, repository: &Path, from: Option<&str>, to: &str, scope: UnitScope<'_>, ) -> Result<Vec<String>, Self::Error>
Messages of the commits after
from up to to that change scope,
oldest first. Without from the walk reaches the root commit. Merge
commits are left out.Source§fn is_ancestor(
&self,
repository: &Path,
ancestor: &str,
descendant: &str,
) -> Result<bool, Self::Error>
fn is_ancestor( &self, repository: &Path, ancestor: &str, descendant: &str, ) -> Result<bool, Self::Error>
Whether
ancestor is descendant or reachable from it.Source§fn equivalent(
&self,
repository: &Path,
base: &str,
first: &str,
second: &str,
) -> Result<bool, Self::Error>
fn equivalent( &self, repository: &Path, base: &str, first: &str, second: &str, ) -> Result<bool, Self::Error>
Whether the first-parent chains from
base to first and from base
to second have the same length and the same trees and messages.
A chain that does not reach base is equivalent to nothing.Source§impl ProposalGit for SystemGit
impl ProposalGit for SystemGit
Source§fn push_with_lease(
&self,
worktree: &Path,
branch: &str,
expected: Option<&str>,
) -> Result<(), Self::Error>
fn push_with_lease( &self, worktree: &Path, branch: &str, expected: Option<&str>, ) -> Result<(), Self::Error>
Emulates --force-with-lease by reading the remote branch head
immediately before a forced push; a concurrent update between the
read and the push can still be overwritten.
Source§fn fetch_if_present(
&self,
repository: &Path,
refspec: &str,
) -> Result<(), Self::Error>
fn fetch_if_present( &self, repository: &Path, refspec: &str, ) -> Result<(), Self::Error>
Like
fetch, but succeed when the remote has no reference named by
refspec.Source§fn fetch(&self, repository: &Path, refspec: &str) -> Result<(), Self::Error>
fn fetch(&self, repository: &Path, refspec: &str) -> Result<(), Self::Error>
Update local references from
origin as refspec maps them.Source§fn worktree_add(
&self,
repository: &Path,
path: &Path,
baseline: &str,
) -> Result<(), Self::Error>
fn worktree_add( &self, repository: &Path, path: &Path, baseline: &str, ) -> Result<(), Self::Error>
Create a disposable worktree at the not yet existing
path, checked
out to baseline on a private branch.Source§fn worktree_remove(
&self,
repository: &Path,
path: &Path,
) -> Result<(), Self::Error>
fn worktree_remove( &self, repository: &Path, path: &Path, ) -> Result<(), Self::Error>
Remove a worktree created with
ProposalGit::worktree_add.Auto Trait Implementations§
impl Freeze for SystemGit
impl RefUnwindSafe for SystemGit
impl Send for SystemGit
impl Sync for SystemGit
impl Unpin for SystemGit
impl UnsafeUnpin for SystemGit
impl UnwindSafe for SystemGit
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