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.
This commit is contained in:
Edward Thomson 2015-05-19 17:51:13 -04:00
parent 253a05f76b
commit 1c4b5cee00
2 changed files with 9 additions and 0 deletions

View File

@ -197,6 +197,14 @@ git_repository *cl_git_sandbox_init(const char *sandbox)
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)
{
if (_cl_repo) {

View File

@ -127,6 +127,7 @@ int cl_rename(const char *source, const char *dest);
/* Git sandbox setup helpers */
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);
git_repository *cl_git_sandbox_reopen(void);