skip loading an index if we loaded the repo as bare

This commit is contained in:
Brian Lopez
2017-03-02 16:34:14 -08:00
parent 06f2e3d0ce
commit 634dbfa020

View File

@@ -634,7 +634,7 @@ static int collect_attr_files(
info.attr_session = attr_session;
info.flags = flags;
info.workdir = workdir;
if (git_repository_index__weakptr(&info.index, repo) < 0)
if (!repo->is_bare && git_repository_index__weakptr(&info.index, repo) < 0)
giterr_clear(); /* no error even if there is no index */
info.files = files;