pub struct Subtrees { /* private fields */ }
Expand description
Manages subtrees in a repository
Implementations§
Source§impl Subtrees
impl Subtrees
Sourcepub fn new() -> Result<Self, SubtreesError>
pub fn new() -> Result<Self, SubtreesError>
§Errors
Throws SubtreesError
if fails to find or access repository.
Sourcepub fn from_repo(repo: Repository) -> Result<Self, SubtreesError>
pub fn from_repo(repo: Repository) -> Result<Self, SubtreesError>
Discover subtrees in a git repository
Sourcepub fn from_dir(path: &Path) -> Result<Self, SubtreesError>
pub fn from_dir(path: &Path) -> Result<Self, SubtreesError>
Discover subtrees in specified directory
Sourcepub fn add(
&self,
subtree: &SubtreeConfig,
revision: Option<&str>,
subject: Option<&str>,
) -> Result<(), AdditionError>
pub fn add( &self, subtree: &SubtreeConfig, revision: Option<&str>, subject: Option<&str>, ) -> Result<(), AdditionError>
Sourcepub fn all(&self) -> Result<Vec<SubtreeConfig>, ConfigError>
pub fn all(&self) -> Result<Vec<SubtreeConfig>, ConfigError>
§Errors
Throws ConfigError
if something goes wrong during parsing
Sourcepub fn pull(
&self,
subtree: &SubtreeConfig,
git_ref: &str,
) -> Result<String, PullError>
pub fn pull( &self, subtree: &SubtreeConfig, git_ref: &str, ) -> Result<String, PullError>
Pull remote changes in the specified subtree
Sourcepub fn split(&self, subtree: &SubtreeConfig) -> Result<(), SplitError>
pub fn split(&self, subtree: &SubtreeConfig) -> Result<(), SplitError>
Split changes in a subtree to own artificial history and merge it back into HEAD
Sourcepub fn push(
&self,
subtree: &SubtreeConfig,
git_ref: &str,
) -> Result<(), PushError>
pub fn push( &self, subtree: &SubtreeConfig, git_ref: &str, ) -> Result<(), PushError>
Push subtree changes to remote
Sourcepub fn changed_modules(
&self,
id: &str,
) -> Result<Vec<SubtreeConfig>, ConfigError>
pub fn changed_modules( &self, id: &str, ) -> Result<Vec<SubtreeConfig>, ConfigError>
List modules with changes since specified git commit id
Sourcepub fn find_subtree(&self, needle: &str) -> Result<SubtreeConfig, FindError>
pub fn find_subtree(&self, needle: &str) -> Result<SubtreeConfig, FindError>
Find subtree by name
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Subtrees
impl RefUnwindSafe for Subtrees
impl Send for Subtrees
impl Sync for Subtrees
impl Unpin for Subtrees
impl UnwindSafe for Subtrees
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more