libgit2

git_diff_patch_print

Version:

Serialize the patch to text via callback.

Returning a non-zero value from the callback will terminate the iteration and cause this return GIT_EUSER.

Signature

int git_diff_patch_print(git_diff_patch *patch, git_diff_data_cb print_cb, void *payload);

Parameters

In
patch

A git_diff_patch representing changes to one file

In
print_cb

Callback function to output lines of the patch. Will be called for file headers, hunk headers, and diff lines.

void *
In
payload

Reference pointer that will be passed to your callbacks.

Returns

int

0 on success, GIT_EUSER on non-zero callback, or error code

Versions