repository: initialize the_repository in main()

This simplifies initialization of struct repository and anything
inside. Easier to read. Easier to add/remove fields.

Everything will go through main() common-main.c so this should cover all
programs, including t/helper.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Nguyễn Thái Ngọc Duy
2018-03-03 18:35:54 +07:00
committed by Junio C Hamano
parent b2e45c695d
commit b2f0eceecf
3 changed files with 16 additions and 6 deletions

View File

@ -91,7 +91,7 @@ extern struct repository *the_repository;
extern void repo_set_gitdir(struct repository *repo, const char *path);
extern void repo_set_worktree(struct repository *repo, const char *path);
extern void repo_set_hash_algo(struct repository *repo, int algo);
extern int repo_init(struct repository *repo, const char *gitdir, const char *worktree);
extern void initialize_the_repository(void);
extern int repo_submodule_init(struct repository *submodule,
struct repository *superproject,
const char *path);