Implement TUI search and mutation workflows
This commit is contained in:
1 parent
c86ea9eb0e
commit
ce3e4a9f79
13 files changed
+1195
-93
No files matched your search
@@ -275,6 +275,36 @@ pub enum AutomaticPolicyCommitter {
|
||||
None(crate::recipient::NoGitCommitter),
|
||||
}
|
||||
|
||||
/// Storage-owned selection of pass-compatible automatic Git commits for a
|
||||
/// remove, move, or copy transaction.
|
||||
pub enum AutomaticTreeCommitter {
|
||||
Git(Box<GitRepository>),
|
||||
None(crate::mutation::NoGitTreeCommitter),
|
||||
}
|
||||
|
||||
impl AutomaticTreeCommitter {
|
||||
pub fn for_source(
|
||||
repository: &Repository,
|
||||
source: &str,
|
||||
identity: GitIdentity,
|
||||
) -> Result<Self, GitError> {
|
||||
match GitRepository::open_innermost(repository, Path::new(source), identity) {
|
||||
Ok(git) => Ok(Self::Git(Box::new(git))),
|
||||
Err(GitError::NotRepository) => Ok(Self::None(crate::mutation::NoGitTreeCommitter)),
|
||||
Err(error) => Err(error),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl TreeCommitter for AutomaticTreeCommitter {
|
||||
fn commit(&mut self, change: &TreeCommit) -> Result<(), TreeCommitError> {
|
||||
match self {
|
||||
Self::Git(git) => TreeCommitter::commit(git.as_mut(), change),
|
||||
Self::None(committer) => committer.commit(change),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl AutomaticPolicyCommitter {
|
||||
pub fn for_directory(
|
||||
repository: &Repository,
|
||||
|
||||
Reference in new issue
Block a user