git_diff_tree_to_index

Create a diff between a tree and repository index.

This is equivalent to git diff --cached <treeish> or if you pass the HEAD tree, then like git diff --cached.

The tree you pass will be used for the "old_file" side of the delta, and the index will be used for the "new_file" side of the delta.

If you pass null for the index, then the existing index of the repo will be used. In this case, the index will be refreshed from disk (if it has changed) before the diff is generated.

Parameters

diff .git_diff**

Output pointer to a git_diff pointer to be allocated.

repo libgit2_d.types.git_repository*

The repository containing the tree and index.

old_tree libgit2_d.types.git_tree*

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

index libgit2_d.types.git_index*

The index to diff with; repo index used if null.

opts const(.git_diff_options)*

Structure with options to influence diff or null for defaults.

Meta