Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-07-24 01:34:31 +0400
committerRussell Belfer <rb@github.com>2013-07-24 01:34:31 +0400
commit197b8966dba18770e4b77a17173c8f354ac175e3 (patch)
tree773f3621e87acf5543bb0443f8f1ba0437c78719 /src/diff.h
parentb4a4cf24a539ce07d86fed6835c98154fb40e723 (diff)
Add hunk/file headers to git_diff_patch_size
This allows git_diff_patch_size to account for hunk headers and file headers in the returned size. This required some refactoring of the code that is used to print file headers so that it could be invoked by the git_diff_patch_size API. Also this increases the test coverage and fixes an off-by-one bug in the size calculation when newline changes happen at the end of the file.
Diffstat (limited to 'src/diff.h')
-rw-r--r--src/diff.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/diff.h b/src/diff.h
index d09a130bc..ff480324f 100644
--- a/src/diff.h
+++ b/src/diff.h
@@ -81,6 +81,13 @@ extern const char *git_diff_delta__path(const git_diff_delta *delta);
extern bool git_diff_delta__should_skip(
const git_diff_options *opts, const git_diff_delta *delta);
+extern int git_diff_delta__format_file_header(
+ git_buf *out,
+ const git_diff_delta *delta,
+ const char *oldpfx,
+ const char *newpfx,
+ int oid_strlen);
+
extern int git_diff__oid_for_file(
git_repository *, const char *, uint16_t, git_off_t, git_oid *);