From 1c4b5cee0079f61c9fad77f8954a873d91f6d81a Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Tue, 19 May 2015 17:51:13 -0400 Subject: [PATCH] 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. --- tests/clar_libgit2.c | 8 ++++++++ tests/clar_libgit2.h | 1 + 2 files changed, 9 insertions(+) diff --git a/tests/clar_libgit2.c b/tests/clar_libgit2.c index 6087c2a67..dabc47a09 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 86c90b049..9ab0da4f6 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);