git_diff_tree_to_workdir

Create a diff between a tree and the working directory.

The tree you provide will be used for the "old_file" side of the delta, and the working directory will be used for the "new_file" side.

This is not the same as git diff <treeish> or `git diff-index <treeish>`. Those commands use information from the index, whereas this function strictly returns the differences between the tree and the files in the working directory, regardless of the state of the index. Use git_diff_tree_to_workdir_with_index to emulate those commands.

To see difference between this and git_diff_tree_to_workdir_with_index, consider the example of a staged file deletion where the file has then been put back into the working dir and further modified. The tree-to-workdir diff for that file is 'modified', but git diff would show status 'deleted' since there is a staged delete.

extern (C) nothrow @nogc
int
git_diff_tree_to_workdir

Parameters

diff .git_diff**

A pointer to a git_diff pointer that will be allocated.

repo libgit2_d.types.git_repository*

The repository containing the tree.

old_tree libgit2_d.types.git_tree*

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

opts const(.git_diff_options)*

Structure with options to influence diff or null for defaults.

Meta