libgit2

git_diff_tree_to_tree

Version:

Create a diff list with the difference between two tree objects.

This is equivalent to git diff <old -tree> <new -tree>

The first tree will be used for the "old_file" side of the delta and the second tree will be used for the "new_file" side of the delta. You can pass NULL to indicate an empty tree, although it is an error to pass NULL for both the old_tree and new_tree.

Signature

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

Parameters

In
diff

Output pointer to a git_diff_list pointer to be allocated.

In
repo

The repository containing the trees.

In
old_tree

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

In
new_tree

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

In
opts

Structure with options to influence diff or NULL for defaults.

Returns

int

Versions