libgit2

git_index_get_bypath

Version:

Get a pointer to one of the entries in the index

The entry is not modifiable and should not be freed. Because the git_index_entry struct is a publicly defined struct, you should be able to make your own permanent copy of the data if necessary.

Signature

const git_index_entry *git_index_get_bypath(git_index *index, const char *path, int stage);

Parameters

In
index

an existing index object

const char *
In
path

path to search

int
In
stage

stage to search

Returns

a pointer to the entry; NULL if it was not found

Versions