Commit 854b5c70 by Patrick Steinhardt

repository: expose `repo_init_create_head`

Expose the function `repo_init_create_head` as
`git_repository_create_head`.
parent 4292837d
...@@ -1262,7 +1262,7 @@ static int check_repositoryformatversion(git_config *config) ...@@ -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( ...@@ -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)
......
...@@ -154,6 +154,7 @@ GIT_INLINE(git_attr_cache *) git_repository_attr_cache(git_repository *repo) ...@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment