Function gix_worktree::status
source · pub fn status<'index, T, Find, E>(
index: &'index mut State,
worktree: &Path,
collector: &mut impl VisitEntry<'index, ContentChange = T>,
compare: impl CompareBlobs<Output = T> + Send + Clone,
find: Find,
options: Options
) -> Result<(), Error>where
T: Send,
E: Error + Send + Sync + 'static,
Find: for<'a> FnMut(&oid, &'a mut Vec<u8>) -> Result<BlobRef<'a>, E> + Send + Clone,
Expand description
Calculates the changes that need to be applied to an index
to match the state of the worktree
and makes them
observable in collector
, along with information produced by compare
which gets to see blobs that may have changes.
options
are used to configure the operation.
Note that index
is updated with the latest seen stat information from the worktree, and its timestamp is adjusted to
the current time for which it will be considered fresh.
Note that this isn’t technically quite what this function does as this also provides some additional information,
like whether a file has conflicts, and files that were added with git add
are shown as a special
changes despite not technically requiring a change to the index since git add
already added the file to the index.