libgit2

git_repository_index

Version:

Get the Index file of a Git repository

This is a cheap operation; the index is only opened on the first call, and subsequent calls only retrieve the previous pointer.

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

0 on success; error code if the index could not be opened

Versions