diff options
author | Russell Belfer <rb@github.com> | 2013-06-12 14:18:09 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-06-12 14:18:09 -0700 |
commit | 360f42f4b3f5de31270416220bd799b951202b2d (patch) | |
tree | 75ce2285f6346e178e1a239f0412eb4597774883 /src/diff_print.c | |
parent | ef3374a8a81786a7b544ed7eded53c95766eb02f (diff) | |
download | libgit2-360f42f4b3f5de31270416220bd799b951202b2d.tar.gz |
Fix diff header naming issues
This makes the git_diff_patch definition private to diff_patch.c
and fixes a number of other header file naming inconsistencies to
use `git_` prefixes on functions and structures that are shared
between files.
Diffstat (limited to 'src/diff_print.c')
-rw-r--r-- | src/diff_print.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/src/diff_print.c b/src/diff_print.c index 860876531..244aa6e1d 100644 --- a/src/diff_print.c +++ b/src/diff_print.c @@ -383,29 +383,13 @@ int git_diff_patch_print( int error; git_buf temp = GIT_BUF_INIT; diff_print_info pi; - size_t h, l; assert(patch && print_cb); if (!(error = diff_print_info_init( - &pi, &temp, patch->diff, print_cb, payload))) - error = print_patch_file(patch->delta, 0, &pi); - - for (h = 0; h < git_array_size(patch->hunks) && !error; ++h) { - diff_patch_hunk *hunk = git_array_get(patch->hunks, h); - - error = print_patch_hunk( - patch->delta, &hunk->range, hunk->header, hunk->header_len, &pi); - - for (l = 0; l < hunk->line_count && !error; ++l) { - diff_patch_line *line = - git_array_get(patch->lines, hunk->line_start + l); - - error = print_patch_line( - patch->delta, &hunk->range, - line->origin, line->ptr, line->len, &pi); - } - } + &pi, &temp, git_diff_patch__diff(patch), print_cb, payload))) + error = git_diff_patch__invoke_callbacks( + patch, print_patch_file, print_patch_hunk, print_patch_line, &pi); git_buf_free(&temp); |