@@ -350,6 +350,22 @@ typedef int (*git_diff_notify_cb)(
350350 const char * matched_pathspec ,
351351 void * payload );
352352
353+ /**
354+ * Diff progress callback.
355+ *
356+ * Called before each file comparison.
357+ *
358+ * @param diff_so_far The diff being generated.
359+ * @param old_path The path to the old file or NULL.
360+ * @param new_path The path to the new file or NULL.
361+ * @return Non-zero to abort the diff.
362+ */
363+ typedef int (* git_diff_progress_cb )(
364+ const git_diff * diff_so_far ,
365+ const char * old_path ,
366+ const char * new_path ,
367+ void * payload );
368+
353369/**
354370 * Structure describing options about how the diff should be executed.
355371 *
@@ -370,8 +386,10 @@ typedef int (*git_diff_notify_cb)(
370386 * - `max_size` is a file size (in bytes) above which a blob will be marked
371387 * as binary automatically; pass a negative value to disable.
372388 * - `notify_cb` is an optional callback function, notifying the consumer of
373- * which files are being examined as the diff is generated
374- * - `notify_payload` is the payload data to pass to the `notify_cb` function
389+ * changes to the diff as new deltas are added.
390+ * - `progress_cb` is an optional callback function, notifying the consumer of
391+ * which files are being examined as the diff is generated.
392+ * - `payload` is the payload to pass to the callback functions.
375393 * - `ignore_submodules` overrides the submodule ignore setting for all
376394 * submodules in the diff.
377395 */
@@ -383,8 +401,9 @@ typedef struct {
383401
384402 git_submodule_ignore_t ignore_submodules ; /**< submodule ignore rule */
385403 git_strarray pathspec ; /**< defaults to include all paths */
386- git_diff_notify_cb notify_cb ;
387- void * notify_payload ;
404+ git_diff_notify_cb notify_cb ;
405+ git_diff_progress_cb progress_cb ;
406+ void * payload ;
388407
389408 /* options controlling how to diff text is generated */
390409
@@ -403,7 +422,7 @@ typedef struct {
403422 * `git_diff_options_init` programmatic initialization.
404423 */
405424#define GIT_DIFF_OPTIONS_INIT \
406- {GIT_DIFF_OPTIONS_VERSION, 0, GIT_SUBMODULE_IGNORE_UNSPECIFIED, {NULL,0}, NULL, NULL, 3}
425+ {GIT_DIFF_OPTIONS_VERSION, 0, GIT_SUBMODULE_IGNORE_UNSPECIFIED, {NULL,0}, NULL, NULL, NULL, 3}
407426
408427/**
409428 * Initializes a `git_diff_options` with default values. Equivalent to
0 commit comments