Enum git_wrapper::Repository
source · [−]pub enum Repository {
Bare {
git_dir: AbsoluteDirPath,
},
Normal {
git_dir: AbsoluteDirPath,
work_tree: AbsoluteDirPath,
},
}Expand description
The main repository object.
This wrapper allows to keep track of optional git-dir and work-tree directories when
executing commands. This functionality was needed for glv & git-stree project.
Variants
Bare
Fields
git_dir: AbsoluteDirPathNormal
Implementations
Constructors
Functions
Return config value for specified key
Errors
See CommitError
Panics
When git-commit(1) fails to execute
Read file from workspace or use git-show(1) if bare repository
Panics
When UTF-8 encoding path fails
Errors
When fails throws std::io::Error
pub fn remote_ref_to_id(
&self,
remote: &str,
git_ref: &str
) -> Result<String, RefSearchError>
pub fn remote_ref_to_id(
&self,
remote: &str,
git_ref: &str
) -> Result<String, RefSearchError>
Errors
See RefSearchError
pub fn subtree_add(
&self,
url: &str,
prefix: &str,
revision: &str,
message: &str
) -> Result<(), SubtreeAddError>
pub fn subtree_add(
&self,
url: &str,
prefix: &str,
revision: &str,
message: &str
) -> Result<(), SubtreeAddError>
pub fn subtree_pull(
&self,
remote: &str,
prefix: &str,
git_ref: &str,
message: &str
) -> Result<(), SubtreePullError>
pub fn subtree_pull(
&self,
remote: &str,
prefix: &str,
git_ref: &str,
message: &str
) -> Result<(), SubtreePullError>
pub fn subtree_push(
&self,
remote: &str,
prefix: &str,
git_ref: &str
) -> Result<(), SubtreePushError>
pub fn subtree_push(
&self,
remote: &str,
prefix: &str,
git_ref: &str
) -> Result<(), SubtreePushError>
Errors
Fails if current repo is bare. In other error cases see the provided message string.
Commit Functions
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Repository
impl Send for Repository
impl Sync for Repository
impl Unpin for Repository
impl UnwindSafe for Repository
Blanket Implementations
Mutably borrows from an owned value. Read more