[][src]Struct radicle_surf::vcs::git::GitRepository

pub struct 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]

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.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.