git_diff_index_to_workdir

Create a diff between the repository index and the workdir directory.

This matches the git diff command. See the note below on git_diff_tree_to_workdir for a discussion of the difference between git diff and git diff HEAD and how to emulate a git diff <treeish> using libgit2.

The index will be used for the "old_file" side of the delta, and the working directory 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.

extern (C) nothrow @nogc
int
git_diff_index_to_workdir

Parameters

diff .git_diff**

Output pointer to a git_diff pointer to be allocated.

repo libgit2_d.types.git_repository*

The repository.

index libgit2_d.types.git_index*

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

opts const(.git_diff_options)*

Structure with options to influence diff or null for defaults.

Meta