pub enum State {
CreateDirectoryAndAttributesStack {
unlink_on_collision: bool,
test_mkdir_calls: usize,
attributes: Attributes,
},
AttributesAndIgnoreStack {
attributes: Attributes,
ignore: Ignore,
},
IgnoreStack(Ignore),
}
Variants§
CreateDirectoryAndAttributesStack
Fields
§
unlink_on_collision: bool
If there is a symlink or a file in our path, try to unlink it before creating the directory.
§
attributes: Attributes
State to handle attribute information
Useful for checkout where directories need creation, but we need to access attributes as well.
AttributesAndIgnoreStack
Fields
§
attributes: Attributes
State to handle attribute information
Used when adding files, requiring access to both attributes and ignore information, for example during add operations.
IgnoreStack(Ignore)
Used when providing worktree status information.
Implementations§
source§impl State
impl State
sourcepub fn for_checkout(unlink_on_collision: bool, attributes: Attributes) -> State
pub fn for_checkout(unlink_on_collision: bool, attributes: Attributes) -> State
Configure a state to be suitable for checking out files.
sourcepub fn for_add(attributes: Attributes, ignore: Ignore) -> State
pub fn for_add(attributes: Attributes, ignore: Ignore) -> State
Configure a state for adding files.
sourcepub fn for_status(ignore: Ignore) -> State
pub fn for_status(ignore: Ignore) -> State
Configure a state for status retrieval.
source§impl State
impl State
sourcepub fn build_attribute_list(
&self,
index: &State,
paths: &[u8],
case: Case
) -> Vec<(BString, ObjectId), Global> ⓘ
pub fn build_attribute_list( &self, index: &State, paths: &[u8], case: Case ) -> Vec<(BString, ObjectId), Global> ⓘ
Returns a vec of tuples of relative index paths along with the best usable OID for either ignore, attribute files or both.
- ignores entries which aren’t blobs
- ignores ignore entries which are not skip-worktree
- within merges, picks ‘our’ stage both for ignore and attribute files.