diff options
Diffstat (limited to 'repository.c')
-rw-r--r-- | repository.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/repository.c b/repository.c index 5dd1486718..7b02e1dffa 100644 --- a/repository.c +++ b/repository.c @@ -63,8 +63,14 @@ void repo_set_gitdir(struct repository *repo, free(old_gitdir); repo_set_commondir(repo, o->commondir); - expand_base_dir(&repo->objects->objectdir, o->object_dir, + + if (!repo->objects->odb) { + repo->objects->odb = xcalloc(1, sizeof(*repo->objects->odb)); + repo->objects->odb_tail = &repo->objects->odb->next; + } + expand_base_dir(&repo->objects->odb->path, o->object_dir, repo->commondir, "objects"); + free(repo->objects->alternate_db); repo->objects->alternate_db = xstrdup_or_null(o->alternate_db); expand_base_dir(&repo->graft_file, o->graft_file, |