libgit2

git_index_get_byindex

Version:

Get a pointer to one of the entries in the index

The values of this entry can be modified (except the path) and the changes will be written back to disk on the next write() call.

The entry should not be freed by the caller.

Signature

const git_index_entry *git_index_get_byindex(git_index *index, size_t n);

Parameters

In
index

an existing index object

size_t
In
n

the position of the entry

Returns

a pointer to the entry; NULL if out of bounds

Versions