Skip to main content

diff_index_to_worktree

Function diff_index_to_worktree 

Source
pub fn diff_index_to_worktree(
    odb: &Odb,
    index: &Index,
    work_tree: &Path,
) -> Result<Vec<DiffEntry>>
Expand description

Compare the index against the working tree.

This shows “unstaged” changes — modifications not yet staged.

Entries with IndexEntry::assume_unchanged or IndexEntry::skip_worktree are treated as matching the work tree without examining the filesystem (Git CE_VALID / skip-worktree).

§Parameters

  • odb — object database (for hashing worktree files).
  • index — the current index.
  • work_tree — path to the working tree root.

§Errors

Returns errors from I/O or hashing.