git_diff_line

Structure describing a line (or data span) of a diff.

A line is a range of characters inside a hunk. It could be a context line (i.e. in both old and new versions), an added line (i.e. only in the new version), or a removed line (i.e. only in the old version). Unfortunately, we don't know anything about the encoding of data in the file being diffed, so we cannot tell you much about the line content. Line data will not be NUL-byte terminated, however, because it will be just a span of bytes inside the larger file.

Members

Variables

content
const(char)* content;

Pointer to diff text, not NUL-byte terminated

content_len
size_t content_len;

Number of bytes of data

content_offset
libgit2_d.types.git_off_t content_offset;

Offset in the original file to the content

new_lineno
int new_lineno;

Line number in new file or -1 for deleted line

num_lines
int num_lines;

Number of newline characters in content

old_lineno
int old_lineno;

Line number in old file or -1 for added line

origin
char origin;

A git_diff_line_t value

Meta