pub struct UpdateIndexPathMode {
pub add: bool,
pub remove: bool,
pub force_remove: bool,
pub info_only: bool,
pub chmod: Option<bool>,
}Expand description
A single positional path passed to update-index, together with the
mode that was active at the point the path was seen on the command line.
git’s update-index processes argv left-to-right with parse_options_step
(PARSE_OPT_STOP_AT_NON_OPTION): the mode flags --add/--remove/
--force-remove/--info-only/--chmod set sticky global state, and each
non-option path is handed to update_one() under whatever state is in
effect at that point. So --add foo --force-remove bar ADDs foo and
FORCE-REMOVEs bar — the flags are positional, not global. We mirror that
by snapshotting the mode onto each path as it is parsed, rather than
applying one batch-wide UpdateIndexOptions to every path.
--chmod=(+|-)x is likewise sticky (--chmod=+x A --chmod=-x B flips A
executable and B non-executable). Each path reports its action
(add '<p>', remove '<p>', chmod (+|-)x '<p>') inline under --verbose,
interleaved in command-line order — which is why the mode must travel with
the path.
Fields§
§add: bool§remove: bool§force_remove: bool§info_only: bool§chmod: Option<bool>--chmod=+x → Some(true), --chmod=-x → Some(false), else None.
Trait Implementations§
Source§impl Clone for UpdateIndexPathMode
impl Clone for UpdateIndexPathMode
Source§fn clone(&self) -> UpdateIndexPathMode
fn clone(&self) -> UpdateIndexPathMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for UpdateIndexPathMode
Source§impl Debug for UpdateIndexPathMode
impl Debug for UpdateIndexPathMode
Source§impl Default for UpdateIndexPathMode
impl Default for UpdateIndexPathMode
Source§fn default() -> UpdateIndexPathMode
fn default() -> UpdateIndexPathMode
impl Eq for UpdateIndexPathMode
Source§impl PartialEq for UpdateIndexPathMode
impl PartialEq for UpdateIndexPathMode
Source§fn eq(&self, other: &UpdateIndexPathMode) -> bool
fn eq(&self, other: &UpdateIndexPathMode) -> bool
self and other values to be equal, and is used by ==.