repository: expose repo_init_create_head

Expose the function `repo_init_create_head` as
`git_repository_create_head`.
This commit is contained in:
Patrick Steinhardt 2015-10-26 16:21:09 +01:00
parent 4292837d50
commit 854b5c70e3
2 changed files with 3 additions and 2 deletions

View File

@ -1262,7 +1262,7 @@ static int check_repositoryformatversion(git_config *config)
return 0; return 0;
} }
static int repo_init_create_head(const char *git_dir, const char *ref_name) int git_repository_create_head(const char *git_dir, const char *ref_name)
{ {
git_buf ref_path = GIT_BUF_INIT; git_buf ref_path = GIT_BUF_INIT;
git_filebuf ref = GIT_FILEBUF_INIT; git_filebuf ref = GIT_FILEBUF_INIT;
@ -1959,7 +1959,7 @@ int git_repository_init_ext(
repo_path.ptr, wd, opts)) && repo_path.ptr, wd, opts)) &&
!(error = repo_init_config( !(error = repo_init_config(
repo_path.ptr, wd, opts->flags, opts->mode))) repo_path.ptr, wd, opts->flags, opts->mode)))
error = repo_init_create_head( error = git_repository_create_head(
repo_path.ptr, opts->initial_head); repo_path.ptr, opts->initial_head);
} }
if (error < 0) if (error < 0)

View File

@ -154,6 +154,7 @@ GIT_INLINE(git_attr_cache *) git_repository_attr_cache(git_repository *repo)
} }
int git_repository_head_tree(git_tree **tree, git_repository *repo); int git_repository_head_tree(git_tree **tree, git_repository *repo);
int git_repository_create_head(const char *git_dir, const char *ref_name);
/* /*
* Weak pointers to repository internals. * Weak pointers to repository internals.