libgit2

git_index_open_bare

Version:

Create a new Git index object as a memory representation of the Git index file in 'index_path', without a repository to back it.

Since there is no ODB behind this index, any Index methods which rely on the ODB (e.g. index_add) will fail with the GIT_EBAREINDEX error code.

Signature

int git_index_open_bare(git_index **index, const char *index_path);

Parameters

In
index

the pointer for the new index

const char *
In
index_path

the path to the index file in disk

Returns

int

0 on success; error code otherwise

Versions