pub fn sync_worktree(
store: &mut Store,
repo: &Repo,
cache: &ObjectCache,
extractor: &dyn Extractor,
) -> Result<SyncReport, SyncError>Expand description
Sync store to the working tree: the committed HEAD state with uncommitted
edits to tracked files overlaid on top (a pre-commit preview).
Committed blobs come from the content-addressed cache as in sync; then
each tracked file whose working copy differs from its committed blob is
re-extracted in memory (never cached, since dirty content is not a git
object), and deleted files are dropped. New untracked files are not yet
included. The recorded sync state encodes the dirty set, so a later
committed sync correctly supersedes the overlay.
ยงErrors
Returns a SyncError if git access, extraction caching, working-tree I/O,
or the store rebuild fails.