[−][src]Struct radicle_surf::vcs::git::GitRepository
Wrapper around the git2
's git2::Repository
type.
This is to to limit the functionality that we can do
on the underlying object.
Methods
impl<'repo> GitRepository
[src]
pub fn new(repo_uri: &str) -> Result<Self, GitError>
[src]
Open a git repository given its URI.
Examples
use radicle_surf::vcs::git::{Branch, BranchName, GitBrowser, GitRepository}; let repo = GitRepository::new("./data/git-platinum").unwrap(); let browser = GitBrowser::new(&repo).unwrap(); let mut branches = browser.list_branches(None).unwrap(); branches.sort(); assert_eq!( branches, vec![ Branch::local(BranchName::new("master")), Branch::remote(BranchName::new("origin/HEAD")), Branch::remote(BranchName::new("origin/dev")), Branch::remote(BranchName::new("origin/master")), ] );
Trait Implementations
impl Debug for GitRepository
[src]
impl From<Repository> for GitRepository
[src]
fn from(repo: Repository) -> Self
[src]
impl<'repo> VCS<'repo, Commit<'repo>, GitError> for GitRepository
[src]
type HistoryId = GitObject
The way to identify a History.
type ArtefactId = Oid
The way to identify an artifact.
fn get_history(
&'repo self,
history_id: Self::HistoryId
) -> Result<GitHistory, GitError>
[src]
&'repo self,
history_id: Self::HistoryId
) -> Result<GitHistory, GitError>
fn get_histories(&'repo self) -> Result<Vec<GitHistory>, GitError>
[src]
fn get_identifier(artifact: &'repo Commit) -> Self::ArtefactId
[src]
Auto Trait Implementations
impl RefUnwindSafe for GitRepository
impl Send for GitRepository
impl !Sync for GitRepository
impl Unpin for GitRepository
impl UnwindSafe for GitRepository
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,