pub struct Context<'a> {
pub pathspec: Search,
pub resource_cache: Platform,
pub should_interrupt: &'a AtomicBool,
pub dirwalk: DirwalkContext<'a>,
}
Available on crate feature
worktree-rewrites
only.Expand description
The context for index_as_worktree_with_renames()`.
Fields§
§pathspec: Search
The pathspec to limit the amount of paths that are checked. Can be empty to allow all paths.
Note that these are expected to have a common_prefix() according to the prefix of the repository to efficiently limit the scope of the paths we process, both for the index modifications as well as for the directory walk.
resource_cache: Platform
A fully-configured platform capable of producing diffable buffers similar to what Git would do, for use with rewrite tracking.
Note that it contains resources that are additionally used here:
attr_stack
- A stack pre-configured to allow accessing attributes for each entry, as required for
filter
and possibly pathspecs. It may also allow accessing.gitignore
information for use in the directory walk. If no excludes information is present, the directory walk will identify ignored files as untracked, which might be desirable under certain circumstances.
- A stack pre-configured to allow accessing attributes for each entry, as required for
filter
- A filter to be able to perform conversions from and to the worktree format. It is needed to potentially refresh the index with data read from the worktree, which needs to be converted back to the form stored in Git.
should_interrupt: &'a AtomicBool
A flag to query to learn if cancellation is requested.
dirwalk: DirwalkContext<'a>
The context for the directory walk.
Auto Trait Implementations§
impl<'a> Freeze for Context<'a>
impl<'a> RefUnwindSafe for Context<'a>
impl<'a> Send for Context<'a>
impl<'a> Sync for Context<'a>
impl<'a> Unpin for Context<'a>
impl<'a> UnwindSafe for Context<'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