diff options
author | Russell Belfer <rb@github.com> | 2013-05-17 16:41:15 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-05-17 16:41:15 -0700 |
commit | aadfa85b0a8f9a8fec4dedd149017a769d54d930 (patch) | |
tree | e87563d4e7f399105a60338eca407858092bd30f /include/git2/diff.h | |
parent | 660d59caa9cd6260fbc980e7da15f806d6d53083 (diff) | |
download | libgit2-aadfa85b0a8f9a8fec4dedd149017a769d54d930.tar.gz |
Add git_diff_print_raw printing helper
Makes it easier to emulate the --raw option
Diffstat (limited to 'include/git2/diff.h')
-rw-r--r-- | include/git2/diff.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/git2/diff.h b/include/git2/diff.h index 1feddd7a2..54966f14a 100644 --- a/include/git2/diff.h +++ b/include/git2/diff.h @@ -689,6 +689,22 @@ GIT_EXTERN(int) git_diff_print_compact( void *payload); /** + * Iterate over a diff generating text output like "git diff --raw". + * + * Returning a non-zero value from the callbacks will terminate the + * iteration and cause this return `GIT_EUSER`. + * + * @param diff A git_diff_list generated by one of the above functions. + * @param print_cb Callback to make per line of diff text. + * @param payload Reference pointer that will be passed to your callback. + * @return 0 on success, GIT_EUSER on non-zero callback, or error code + */ +GIT_EXTERN(int) git_diff_print_raw( + git_diff_list *diff, + git_diff_data_cb print_cb, + void *payload); + +/** * Look up the single character abbreviation for a delta status code. * * When you call `git_diff_print_compact` it prints single letter codes into |