libgit2

git_diff_get_delta

Version:

Return the diff delta for an entry in the diff list.

The git_delta pointer points to internal data and you do not have to release it when you are done with it. It will go away when the git_diff (or any associated git_patch) goes away.

Note that the flags on the delta related to whether it has binary content or not may not be set if there are no attributes set for the file and there has been no reason to load the file data at this point. For now, if you need those flags to be up to date, your only option is to either use git_diff_foreach or create a git_patch.

Signature

const git_diff_delta *git_diff_get_delta(const git_diff *diff, size_t idx);

Parameters

In
diff

Diff list object

size_t
In
idx

Index into diff list

Returns

Pointer to git_diff_delta (or NULL if idx out of range)

Versions