Skip to main content

diff_tree_to_worktree

Function diff_tree_to_worktree 

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

Compare a tree against the working tree.

Shows changes from tree_oid to the current working directory state. Files tracked in the index but not in the tree are shown as Added. Files in the tree but missing from the working tree are shown as Deleted.

§Parameters

  • odb — object database.
  • tree_oid — the tree to compare against (None for empty tree).
  • work_tree — path to the working tree root.
  • index — current index (used to discover new tracked files not in tree).

§Errors

Returns errors from ODB reads or I/O.