pub struct CreateGhostCommitOptions<'a> {
pub repo_path: &'a Path,
pub message: Option<&'a str>,
pub force_include: Vec<PathBuf>,
pub parent: Option<&'a str>,
pub post_commit_hook: Option<&'a dyn Fn()>,
}Expand description
Options to control ghost commit creation.
Fields§
§repo_path: &'a Path§message: Option<&'a str>§force_include: Vec<PathBuf>§parent: Option<&'a str>§post_commit_hook: Option<&'a dyn Fn()>Implementations§
Source§impl<'a> CreateGhostCommitOptions<'a>
impl<'a> CreateGhostCommitOptions<'a>
Sourcepub fn new(repo_path: &'a Path) -> Self
pub fn new(repo_path: &'a Path) -> Self
Creates options scoped to the provided repository path.
Sourcepub fn message(self, message: &'a str) -> Self
pub fn message(self, message: &'a str) -> Self
Sets a custom commit message for the ghost commit.
Sourcepub fn parent(self, parent: &'a str) -> Self
pub fn parent(self, parent: &'a str) -> Self
Overrides the parent commit for the ghost snapshot when provided.
Sourcepub fn post_commit_hook(self, hook: &'a dyn Fn()) -> Self
pub fn post_commit_hook(self, hook: &'a dyn Fn()) -> Self
Registers a hook to run after the ghost commit is created.
Sourcepub fn force_include<I>(self, paths: I) -> Selfwhere
I: IntoIterator<Item = PathBuf>,
pub fn force_include<I>(self, paths: I) -> Selfwhere
I: IntoIterator<Item = PathBuf>,
Supplies the entire force-include path list at once.
Sourcepub fn push_force_include<P>(self, path: P) -> Self
pub fn push_force_include<P>(self, path: P) -> Self
Adds a single path to the force-include list.
Auto Trait Implementations§
impl<'a> Freeze for CreateGhostCommitOptions<'a>
impl<'a> !RefUnwindSafe for CreateGhostCommitOptions<'a>
impl<'a> !Send for CreateGhostCommitOptions<'a>
impl<'a> !Sync for CreateGhostCommitOptions<'a>
impl<'a> Unpin for CreateGhostCommitOptions<'a>
impl<'a> UnsafeUnpin for CreateGhostCommitOptions<'a>
impl<'a> !UnwindSafe for CreateGhostCommitOptions<'a>
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