setup: adopt shared init-db & clone code
The functions init_db() and initialize_repository_version() were shared by builtin/init-db.c and builtin/clone.c, and declared in cache.h. Move these functions, plus their several helpers only used by these functions, to setup.[ch]. Diff best viewed with `--color-moved`. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
fc81735057
commit
e8cf8ef507
9
setup.h
9
setup.h
@ -140,6 +140,15 @@ int verify_repository_format(const struct repository_format *format,
|
||||
*/
|
||||
void check_repository_format(struct repository_format *fmt);
|
||||
|
||||
#define INIT_DB_QUIET 0x0001
|
||||
#define INIT_DB_EXIST_OK 0x0002
|
||||
|
||||
int init_db(const char *git_dir, const char *real_git_dir,
|
||||
const char *template_dir, int hash_algo,
|
||||
const char *initial_branch, int init_shared_repository,
|
||||
unsigned int flags);
|
||||
void initialize_repository_version(int hash_algo, int reinit);
|
||||
|
||||
/*
|
||||
* NOTE NOTE NOTE!!
|
||||
*
|
||||
|
Reference in New Issue
Block a user