Commit 1c4b5cee by Edward Thomson

Introduce cl_git_sandbox_init_new()

cl_git_sandbox_init_new() will create a clar temp directory and
initialize a new repository at that location.
parent 253a05f7
...@@ -197,6 +197,14 @@ git_repository *cl_git_sandbox_init(const char *sandbox) ...@@ -197,6 +197,14 @@ git_repository *cl_git_sandbox_init(const char *sandbox)
return _cl_repo; return _cl_repo;
} }
git_repository *cl_git_sandbox_init_new(const char *sandbox)
{
cl_git_pass(git_repository_init(&_cl_repo, sandbox, false));
_cl_sandbox = sandbox;
return _cl_repo;
}
git_repository *cl_git_sandbox_reopen(void) git_repository *cl_git_sandbox_reopen(void)
{ {
if (_cl_repo) { if (_cl_repo) {
......
...@@ -127,6 +127,7 @@ int cl_rename(const char *source, const char *dest); ...@@ -127,6 +127,7 @@ int cl_rename(const char *source, const char *dest);
/* Git sandbox setup helpers */ /* Git sandbox setup helpers */
git_repository *cl_git_sandbox_init(const char *sandbox); git_repository *cl_git_sandbox_init(const char *sandbox);
git_repository *cl_git_sandbox_init_new(const char *name);
void cl_git_sandbox_cleanup(void); void cl_git_sandbox_cleanup(void);
git_repository *cl_git_sandbox_reopen(void); git_repository *cl_git_sandbox_reopen(void);
......
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