]> git.proxmox.com Git - libgit2.git/blobdiff - tests/worktree/submodule.c
New upstream version 1.4.3+dfsg.1
[libgit2.git] / tests / worktree / submodule.c
index 5620775970b9f8617264489fba330292d5820305..6b0c074526c54969dc1125804c1960501f00708f 100644 (file)
@@ -55,26 +55,26 @@ void test_worktree_submodule__open_discovered_submodule_worktree(void)
        cl_assert_equal_s(git_repository_workdir(child.worktree),
                git_repository_workdir(repo));
 
-       git_buf_free(&path);
+       git_buf_dispose(&path);
        git_repository_free(repo);
 }
 
 void test_worktree_submodule__resolve_relative_url(void)
 {
-       git_buf wt_path = GIT_BUF_INIT;
+       git_str wt_path = GIT_STR_INIT;
        git_buf sm_relative_path = GIT_BUF_INIT, wt_relative_path = GIT_BUF_INIT;
        git_repository *repo;
        git_worktree *wt;
 
        cl_git_pass(git_futils_mkdir("subdir", 0755, GIT_MKDIR_PATH));
-       cl_git_pass(git_path_prettify_dir(&wt_path, "subdir", NULL));
-       cl_git_pass(git_buf_joinpath(&wt_path, wt_path.ptr, "wt"));
+       cl_git_pass(git_fs_path_prettify_dir(&wt_path, "subdir", NULL));
+       cl_git_pass(git_str_joinpath(&wt_path, wt_path.ptr, "wt"));
 
        /* Open child repository, which is a submodule */
        cl_git_pass(git_repository_open(&child.repo, WORKTREE_CHILD));
 
        /* Create worktree of submodule repository */
-       cl_git_pass(git_worktree_add(&wt, child.repo, "subdir", wt_path.ptr));
+       cl_git_pass(git_worktree_add(&wt, child.repo, "subdir", wt_path.ptr, NULL));
        cl_git_pass(git_repository_open_from_worktree(&repo, wt));
 
        cl_git_pass(git_submodule_resolve_url(&sm_relative_path, repo,
@@ -86,7 +86,7 @@ void test_worktree_submodule__resolve_relative_url(void)
 
        git_worktree_free(wt);
        git_repository_free(repo);
-       git_buf_free(&wt_path);
-       git_buf_free(&sm_relative_path);
-       git_buf_free(&wt_relative_path);
+       git_str_dispose(&wt_path);
+       git_buf_dispose(&sm_relative_path);
+       git_buf_dispose(&wt_relative_path);
 }