mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 06:20:56 +00:00
Only require an index for non-bare repos.
This commit is contained in:
parent
6fd195d76c
commit
1544bc31ca
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user