pub struct Repo { /* private fields */ }
Expand description
Repository
Implementations§
source§impl Repo
impl Repo
sourcepub fn new(directory: impl AsRef<Path>) -> Result<Self>
pub fn new(directory: impl AsRef<Path>) -> Result<Self>
Returns an error if the directory doesn’t contain any commit
pub fn directory(&self) -> &Path
pub fn checkout_new_branch(&self, branch: &str) -> Result<()>
pub fn add_all_and_commit(&self, message: &str) -> Result<()>
pub fn changes_expect_typechanges(&self) -> Result<Vec<String>>
pub fn add<T: AsRef<str>>(&self, paths: &[T]) -> Result<()>
pub fn commit(&self, message: &str) -> Result<()>
pub fn push(&self, obj: &str) -> Result<()>
pub fn checkout_head(&self) -> Result<()>
pub fn default_branch(&self) -> &str
sourcepub fn checkout_last_commit_at_path(&self, path: &Path) -> Result<()>
pub fn checkout_last_commit_at_path(&self, path: &Path) -> Result<()>
Checkout to the latest commit.