Create a new bare 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 or working directory behind this index, any Index methods which rely on these (e.g. index_add) will fail with the GIT_EBAREINDEX error code.
If you need to access the index of an actual repository,
use the git_repository_index
wrapper.
The index must be freed once it's no longer in use.
the path to the index file in disk
GIT_SUCCESS or an error code