@@ -171,13 +171,17 @@ static git_repository *_cl_repo = NULL;
171171
172172git_repository * cl_git_sandbox_init (const char * sandbox )
173173{
174+ /* Get the name of the sandbox folder which will be created
175+ */
176+ const char * basename = cl_fixture_basename (sandbox );
177+
174178 /* Copy the whole sandbox folder from our fixtures to our test sandbox
175179 * area. After this it can be accessed with `./sandbox`
176180 */
177181 cl_fixture_sandbox (sandbox );
178182 _cl_sandbox = sandbox ;
179183
180- cl_git_pass (p_chdir (sandbox ));
184+ cl_git_pass (p_chdir (basename ));
181185
182186 /* If this is not a bare repo, then rename `sandbox/.gitted` to
183187 * `sandbox/.git` which must be done since we cannot store a folder
@@ -200,7 +204,7 @@ git_repository *cl_git_sandbox_init(const char *sandbox)
200204 cl_git_pass (p_chdir (".." ));
201205
202206 /* Now open the sandbox repository and make it available for tests */
203- cl_git_pass (git_repository_open (& _cl_repo , sandbox ));
207+ cl_git_pass (git_repository_open (& _cl_repo , basename ));
204208
205209 /* Adjust configs after copying to new filesystem */
206210 cl_git_pass (git_repository_reinit_filesystem (_cl_repo , 0 ));
@@ -222,7 +226,9 @@ git_repository *cl_git_sandbox_reopen(void)
222226 git_repository_free (_cl_repo );
223227 _cl_repo = NULL ;
224228
225- cl_git_pass (git_repository_open (& _cl_repo , _cl_sandbox ));
229+ cl_git_pass (git_repository_open (
230+ & _cl_repo ,
231+ cl_fixture_basename (_cl_sandbox )));
226232 }
227233
228234 return _cl_repo ;
0 commit comments