pub struct RemoveOptions {
pub pathspecs: Vec<String>,
pub pathspec_sources: Vec<String>,
pub cached: bool,
pub force: bool,
pub recursive: bool,
pub dry_run: bool,
pub ignore_unmatch: bool,
}Expand description
Options for remove_paths.
Fields§
§pathspecs: Vec<String>Resolved pathspec patterns (repository-relative).
pathspec_sources: Vec<String>Original pathspec argv fragments for errors (defaults to pathspecs when empty).
cached: boolRemove from the index only; leave the working tree file in place.
force: boolRemove even when the path has staged or unstaged local modifications.
recursive: boolAllow removing directories (all tracked paths under a directory prefix).
dry_run: boolRun every check and report RemoveOutcome::removed without writing the index or work tree.
ignore_unmatch: boolTreat non-matching pathspecs as success with an empty removal list.
Implementations§
Source§impl RemoveOptions
impl RemoveOptions
Sourcepub fn resolve_recursive(&mut self, repo: &Repository) -> Result<()>
pub fn resolve_recursive(&mut self, repo: &Repository) -> Result<()>
When recursive is false, infer directory removal from trailing slashes or existing directories.
§Errors
Returns Error::RequiresWorkTree when the repository has no work tree.
Trait Implementations§
Source§impl Clone for RemoveOptions
impl Clone for RemoveOptions
Source§impl Debug for RemoveOptions
impl Debug for RemoveOptions
Auto Trait Implementations§
impl Freeze for RemoveOptions
impl RefUnwindSafe for RemoveOptions
impl Send for RemoveOptions
impl Sync for RemoveOptions
impl Unpin for RemoveOptions
impl UnsafeUnpin for RemoveOptions
impl UnwindSafe for RemoveOptions
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