diff options
author | Dave Borowitz <dborowitz@google.com> | 2010-11-02 16:02:37 -0700 |
---|---|---|
committer | Dave Borowitz <dborowitz@google.com> | 2010-11-02 16:02:37 -0700 |
commit | 1544bc31ca8822183cf8e1033660e0ea134a59cb (patch) | |
tree | 8aac7f13628defb38ed0f6eb585a07069e364aa1 | |
parent | 6fd195d76c7f52baae5540e287affe2259900d36 (diff) | |
download | libgit2-1544bc31ca8822183cf8e1033660e0ea134a59cb.tar.gz |
Only require an index for non-bare repos.
-rw-r--r-- | src/repository.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/repository.c b/src/repository.c index 433e72916..f64f806aa 100644 --- a/src/repository.c +++ b/src/repository.c @@ -91,12 +91,6 @@ static int parse_repository_folders(git_repository *repo, const char *repository return GIT_ERROR; 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 */ strcpy(path_aux + path_len, "HEAD"); if (gitfo_exists(path_aux) < 0) @@ -112,6 +106,12 @@ static int parse_repository_folders(git_repository *repo, const char *repository path_aux[i + 1] = 0; 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 { repo->is_bare = 1; repo->path_workdir = NULL; |