Enum git_worktree::fs::cache::State
source · 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) -> Self
pub fn for_checkout(unlink_on_collision: bool, attributes: Attributes) -> Self
Configure a state to be suitable for checking out files.
sourcepub fn for_add(attributes: Attributes, ignore: Ignore) -> Self
pub fn for_add(attributes: Attributes, ignore: Ignore) -> Self
Configure a state for adding files.
sourcepub fn for_status(ignore: Ignore) -> Self
pub fn for_status(ignore: Ignore) -> Self
Configure a state for status retrieval.
source§impl State
impl State
sourcepub fn build_attribute_list<'paths>(
&self,
index: &State,
paths: &'paths PathStorageRef,
case: Case
) -> Vec<(BString, ObjectId)> ⓘ
pub fn build_attribute_list<'paths>(
&self,
index: &State,
paths: &'paths PathStorageRef,
case: Case
) -> Vec<(BString, ObjectId)> ⓘ
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.