libgit2

git_diff_print

Version:

Iterate over a diff generating formatted text output.

Returning a non-zero value from the callbacks will terminate the iteration and return the non-zero value to the caller.

Signature

int git_diff_print(git_diff *diff, git_diff_format_t format, git_diff_line_cb print_cb, void *payload);

Parameters

In
diff

A git_diff generated by one of the above functions.

In
format

A git_diff_format_t value to pick the text format.

In
print_cb

Callback to make per line of diff text.

void *
In
payload

Reference pointer that will be passed to your callback.

Returns

int

0 on success, non-zero callback return value, or error code

Versions