int git_index_open_inrepo(git_index **index_out, git_repository *repo) { if (repo->is_bare) return GIT_EBAREINDEX; return index_initialize(index_out, repo, repo->path_index); }
/* * Moved from `repository.c` */ int git_repository_index(git_index **index_out, git_repository *repo) { if (repo->is_bare) return git__throw(GIT_EBAREINDEX, "Failed to open index. Repository is bare"); return index_initialize(index_out, repo, repo->path_index); }
int git_index_open_bare(git_index **index_out, const char *index_path) { return index_initialize(index_out, NULL, index_path); }