[][src]Struct clgit::Repository

pub struct Repository { /* fields omitted */ }

A git repository (a reference to a local path containing a .git directory, or a bare some_repository.git directory)

Implementations

impl Repository[src]

pub fn from_bare_repository(dir: impl Into<PathBuf>) -> Result<Self>[src]

Examples

let repository = clgit::Repository::from_bare_repository(".git").unwrap();

pub fn from_regular_repository(dir: impl AsRef<Path>) -> Result<Self>[src]

Examples

let repository = clgit::Repository::from_regular_repository(".").unwrap();

pub fn from_path(dir: impl AsRef<Path>) -> Result<Self>[src]

Examples

let repository = clgit::Repository::from_path(".").unwrap();
let repository = clgit::Repository::from_path(".git").unwrap();

pub fn local_branches(&self) -> Result<impl Iterator<Item = Result<Branch>>>[src]

Examples

for branch in repository.local_branches()? {
    let branch : clgit::Branch = branch?;
    println!("{}", branch.name().to_string_lossy());
    let _ = branch.commit();
}

pub fn remote_branches(&self) -> Result<impl Iterator<Item = Result<Branch>>>[src]

Examples

for branch in repository.remote_branches()? {
    let branch : clgit::Branch = branch?;
    println!("{}", branch.name().to_string_lossy());
    let _ = branch.commit();
}

pub fn cat_file_size(&self, hash: &Hash) -> Result<u64>[src]

Run/parse git cat-file -s [hash]

pub fn cat_file_type(&self, hash: &Hash) -> Result<FileType>[src]

Run/parse git cat-file -t [hash]

pub fn cat_file_commit(&self, hash: &Hash) -> Result<impl Read>[src]

Run/parse git cat-file commit [hash]

pub fn cat_file_tree(&self, hash: &Hash) -> Result<impl Read>[src]

Run/parse git cat-file tree [hash]

pub fn cat_file_blob(&self, hash: &Hash) -> Result<impl Read>[src]

Run/parse git cat-file blob [hash]

Trait Implementations

impl Clone for Repository[src]

impl Debug for Repository[src]

impl From<Repository> for RepositoryCache[src]

impl TryIntoSharedRepositoryCache for Repository[src]

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.