libgit2

git_index_insert

Version:

Insert an entry into the index. A full copy (including the 'path' string) of the given 'source_entry' will be inserted on the index; if the index already contains an entry for the same path, the entry will be updated.

Signature

int git_index_insert(git_index *index, const git_index_entry *source_entry);

Parameters

In
index

an existing index object

In
source_entry

new entry object

Returns

int

0 on success, otherwise an error code

Versions