diff options
Diffstat (limited to 'tests-clay/repo/open.c')
-rw-r--r-- | tests-clay/repo/open.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tests-clay/repo/open.c b/tests-clay/repo/open.c index 235af1447..05b01ceb2 100644 --- a/tests-clay/repo/open.c +++ b/tests-clay/repo/open.c @@ -26,23 +26,24 @@ void test_repo_open__standard_empty_repo(void) /* TODO TODO */ #if 0 BEGIN_TEST(open2, "Open a bare repository with a relative path escaping out of the current working directory") - char new_current_workdir[GIT_PATH_MAX]; char current_workdir[GIT_PATH_MAX]; - char path_repository[GIT_PATH_MAX]; + git_buf new_current_workdir = GIT_BUF_INIT; + git_buf path_repository = GIT_BUF_INIT; const mode_t mode = 0777; git_repository* repo; /* Setup the repository to open */ must_pass(p_getcwd(current_workdir, sizeof(current_workdir))); - strcpy(path_repository, current_workdir); - git_path_join_n(path_repository, 3, path_repository, TEMP_REPO_FOLDER, "a/d/e.git"); - must_pass(copydir_recurs(REPOSITORY_FOLDER, path_repository)); + must_pass(git_buf_join_n(&path_repository, 3, current_workdir, TEMP_REPO_FOLDER, "a/d/e.git")); + must_pass(copydir_recurs(REPOSITORY_FOLDER, path_repository.ptr)); + git_buf_free(&path_repository); /* Change the current working directory */ - git_path_join(new_current_workdir, TEMP_REPO_FOLDER, "a/b/c/"); - must_pass(git_futils_mkdir_r(new_current_workdir, mode)); - must_pass(chdir(new_current_workdir)); + must_pass(git_buf_joinpath(&new_current_workdir, TEMP_REPO_FOLDER, "a/b/c/")); + must_pass(git_futils_mkdir_r(new_current_workdir.ptr, mode)); + must_pass(chdir(new_current_workdir.ptr)); + git_buf_free(&new_current_workdir); must_pass(git_repository_open(&repo, "../../d/e.git")); |