libgit2

git_diff_notify_cb

Version:

Diff notification callback function.

The callback will be called for each file, just before the git_diff_delta gets inserted into the diff.

When the callback:

  • returns < 0, the diff process will be aborted.
  • returns > 0, the delta will not be inserted into the diff, but the diff process continues.
  • returns 0, the delta is inserted into the diff, and the diff process continues.

Signature

typedef int git_diff_notify_cb(const git_diff *diff_so_far, const git_diff_delta *delta_to_add, const char *matched_pathspec, void *payload);

Parameters

In
diff_so_far

the diff structure as it currently exists

In
delta_to_add

the delta that is to be added

const char *
In
matched_pathspec

the pathspec

void *
In
payload

the user-specified callback payload

Returns

int

0 on success, 1 to skip this delta, or an error code

Versions