libgit2

git_diff_workdir_to_tree

Version:

Compute a difference between the working directory and a tree.

This returns strictly the differences between the tree and the files contained in the working directory, regardless of the state of files in the index. There is no direct equivalent in C git.

This is NOT the same as 'git diff HEAD' or 'git diff <SHA>'. Those commands diff the tree, the index, and the workdir. To emulate those functions, call git_diff_index_to_tree and git_diff_workdir_to_index, then call git_diff_merge on the results.

Signature

int git_diff_workdir_to_tree(git_repository *repo, const git_diff_options *opts, git_tree *old_tree, git_diff_list **diff);

Parameters

In
repo

The repository containing the tree.

In
opts

Structure with options to influence diff or NULL for defaults.

In
old_tree

A git_tree object to diff from.

In
diff

A pointer to a git_diff_list pointer that will be allocated.

Returns

int

Versions