libgit2

git_diff_file

Version:

Description of one side of a delta.

Although this is called a "file", it could represent a file, a symbolic link, a submodule commit id, or even a tree (although that only if you are tracking type changes or ignored/untracked directories).

Signature

typedef struct git_diff_file { git_oid id const char *path git_object_size_t size uint32_t flags uint16_t mode uint16_t id_abbrev };

Members

id

The git_oid of the item. If the entry represents an absent side of a diff (e.g. the old_file of a GIT_DELTA_ADDED delta), then the oid will be zeroes.

const char *
path

The NUL-terminated path to the entry relative to the working directory of the repository.

size

The size of the entry in bytes.

uint32_t
flags

A combination of the git_diff_flag_t types

uint16_t
mode

Roughly, the stat() st_mode value for the item. This will be restricted to one of the git_filemode_t values.

uint16_t
id_abbrev

Represents the known length of the id field, when converted to a hex string. It is generally GIT_OID_SHA1_HEXSIZE, unless this delta was created from reading a patch file, in which case it may be abbreviated to something reasonable, like 7 characters.

Parameter To

Versions