Commit 1c4b5cee0079f61c9fad77f8954a873d91f6d81a

Edward Thomson 2015-05-19T17:51:13

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.

diff --git a/tests/clar_libgit2.c b/tests/clar_libgit2.c
index 6087c2a..dabc47a 100644
--- a/tests/clar_libgit2.c
+++ b/tests/clar_libgit2.c
@@ -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) {
diff --git a/tests/clar_libgit2.h b/tests/clar_libgit2.h
index 86c90b0..9ab0da4 100644
--- a/tests/clar_libgit2.h
+++ b/tests/clar_libgit2.h
@@ -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);