Skip to main content

diff_index_to_tree

Function diff_index_to_tree 

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

Compare the index against a tree (usually HEAD’s tree).

This shows “staged” changes — what would be committed.

§Parameters

  • odb — object database.
  • index — the current index.
  • tree_oid — the tree to compare against (e.g. HEAD’s tree), or None for comparison against an empty tree (initial commit).

§Errors

Returns errors from ODB reads.