Commit 1544bc31 by Dave Borowitz

Only require an index for non-bare repos.

parent 6fd195d7
...@@ -91,12 +91,6 @@ static int parse_repository_folders(git_repository *repo, const char *repository ...@@ -91,12 +91,6 @@ static int parse_repository_folders(git_repository *repo, const char *repository
return GIT_ERROR; return GIT_ERROR;
repo->path_odb = git__strdup(path_aux); repo->path_odb = git__strdup(path_aux);
/* index file */
strcpy(path_aux + path_len, "index");
if (gitfo_exists(path_aux) < 0)
return GIT_ERROR;
repo->path_index = git__strdup(path_aux);
/* HEAD file */ /* HEAD file */
strcpy(path_aux + path_len, "HEAD"); strcpy(path_aux + path_len, "HEAD");
if (gitfo_exists(path_aux) < 0) if (gitfo_exists(path_aux) < 0)
...@@ -112,6 +106,12 @@ static int parse_repository_folders(git_repository *repo, const char *repository ...@@ -112,6 +106,12 @@ static int parse_repository_folders(git_repository *repo, const char *repository
path_aux[i + 1] = 0; path_aux[i + 1] = 0;
repo->path_workdir = git__strdup(path_aux); repo->path_workdir = git__strdup(path_aux);
/* index file */
strcpy(path_aux + path_len, "index");
if (gitfo_exists(path_aux) < 0)
return GIT_ERROR;
repo->path_index = git__strdup(path_aux);
} else { } else {
repo->is_bare = 1; repo->is_bare = 1;
repo->path_workdir = NULL; repo->path_workdir = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment