libgit2

git_patch_size

Version:

Look up size of patch diff data in bytes

This returns the raw size of the patch data. This only includes the actual data from the lines of the diff, not the file or hunk headers.

If you pass include_context as true (non-zero), this will be the size of all of the diff output; if you pass it as false (zero), this will only include the actual changed lines (as if context_lines was 0).

Signature

size_t git_patch_size(git_patch *patch, int include_context, int include_hunk_headers, int include_file_headers);

Parameters

In
patch

A git_patch representing changes to one file

int
In
include_context

Include context lines in size if non-zero

int
In
include_hunk_headers

Include hunk header lines if non-zero

int
In
include_file_headers

Include file header lines if non-zero

Returns

size_t

The number of bytes of data

Versions