libgit2

git_patch_get_line_in_hunk

Version:

Get data about a line in a hunk of a patch.

Given a patch, a hunk index, and a line index in the hunk, this will return a lot of details about that line. If you pass a hunk index larger than the number of hunks or a line index larger than the number of lines in the hunk, this will return -1.

Signature

int git_patch_get_line_in_hunk(const git_diff_line **out, git_patch *patch, size_t hunk_idx, size_t line_of_hunk);

Parameters

In
out

The git_diff_line data for this line

In
patch

The patch to look in

size_t
In
hunk_idx

The index of the hunk

size_t
In
line_of_hunk

The index of the line in the hunk

Returns

int

0 on success, < 0 on failure

Versions