libgit2

git_diff_tree_to_workdir_with_index

Version:

Create a diff between a tree and the working directory using index data to account for staged deletes, tracked files, etc.

This emulates git diff <tree> by diffing the tree to the index and the index to the working directory and blending the results into a single diff that includes staged deleted, etc.

Signature

int git_diff_tree_to_workdir_with_index(git_diff **diff, git_repository *repo, git_tree *old_tree, const git_diff_options *opts);

Parameters

In
diff

A pointer to a git_diff pointer that will be allocated.

In
repo

The repository containing the tree.

In
old_tree

A git_tree object to diff from, or NULL for empty tree.

In
opts

Structure with options to influence diff or NULL for defaults.

Returns

int

0 or an error code.

Versions