diff options
| author | Edward Thomson <ethomson@github.com> | 2016-04-25 12:40:19 -0400 |
|---|---|---|
| committer | Edward Thomson <ethomson@github.com> | 2016-05-26 13:01:09 -0500 |
| commit | 728274904f69fef48752d77c8cf75fc3aaf7808c (patch) | |
| tree | 555080de1f33ec4c5afecb71e6a81a0c060e8ca5 /src/diff_print.c | |
| parent | 7166bb16659790ae2b398e1e95c752f784f6f1d3 (diff) | |
| download | libgit2-728274904f69fef48752d77c8cf75fc3aaf7808c.tar.gz | |
Introduce `git_diff_to_buf`
Like `git_patch_to_buf`, provide a simple helper method that can
print an entire diff directory to a `git_buf`.
Diffstat (limited to 'src/diff_print.c')
| -rw-r--r-- | src/diff_print.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/diff_print.c b/src/diff_print.c index 5bcb5d016..5a5a70b6f 100644 --- a/src/diff_print.c +++ b/src/diff_print.c @@ -714,6 +714,15 @@ int git_diff_print_callback__to_file_handle( return 0; } +/* print a git_diff to a git_buf */ +int git_diff_to_buf(git_buf *out, git_diff *diff, git_diff_format_t format) +{ + assert(out && diff); + git_buf_sanitize(out); + return git_diff_print( + diff, format, git_diff_print_callback__to_buf, out); +} + /* print a git_patch to an output callback */ int git_patch_print( git_patch *patch, |
