libgit2

git_repository_index

Version:

Open the Index file of a Git repository

This returns a new and unique git_index object representing the active index for the repository.

This method may be called more than once (e.g. on different threads).

Each returned git_index object is independent and suffers no race conditions: synchronization is done at the FS level.

Each returned git_index object must be manually freed by the user, using git_index_free.

Signature

int git_repository_index(git_index **index, git_repository *repo);

Parameters

In
index

Pointer where to store the index

In
repo

a repository object

Returns

int

GIT_SUCCESS or an error code

Versions