diff options
author | Vicent Marti <tanoku@gmail.com> | 2011-12-09 01:38:46 +0100 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-12-09 01:38:46 +0100 |
commit | 40e73d6f8886d27ae9c7df059d995221e6d84710 (patch) | |
tree | 4a6136463adbaa22a9aea3eb605d6c0dfbc97a7e /tests-clay/repo/open.c | |
parent | e92386876606c734fae9d2f5bd6c80861ccfe409 (diff) | |
parent | 97769280ba9938ae27f6e06cbd0d5e8a768a86b9 (diff) | |
download | libgit2-40e73d6f8886d27ae9c7df059d995221e6d84710.tar.gz |
Merge remote-tracking branch 'arrbee/git-buf-for-paths' into development
Conflicts:
tests-clay/clay_main.c
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")); |