libgit2

git_apply_hunk_cb

Version:

When applying a patch, callback that will be made per hunk.

When the callback:

  • returns < 0, the apply process will be aborted.
  • returns > 0, the hunk will not be applied, but the apply process continues
  • returns 0, the hunk is applied, and the apply process continues.

Signature

typedef int git_apply_hunk_cb(const git_diff_hunk *hunk, void *payload);

Parameters

In
hunk

The hunk to be applied

void *
In
payload

User-specified payload

Returns

int

0 if the hunk is applied, < 0 if the apply process will be aborted or > 0 if the hunk will not be applied.

Versions