]> git.proxmox.com Git - libgit2.git/blobdiff - tests/submodule/init.c
New upstream version 1.4.3+dfsg.1
[libgit2.git] / tests / submodule / init.c
index a1d870b9e744629ddb27a610ed5268a88c7a528a..a8e1291c4e0ea7edda74f66aa52887f93fc422e8 100644 (file)
@@ -15,13 +15,13 @@ void test_submodule_init__absolute_url(void)
 {
        git_submodule *sm;
        git_config *cfg;
-       git_buf absolute_url = GIT_BUF_INIT;
+       git_str absolute_url = GIT_STR_INIT;
        const char *config_url;
 
        g_repo = setup_fixture_submodule_simple();
 
-       cl_assert(git_path_dirname_r(&absolute_url, git_repository_workdir(g_repo)) > 0);
-       cl_git_pass(git_buf_joinpath(&absolute_url, absolute_url.ptr, "testrepo.git"));
+       cl_assert(git_fs_path_dirname_r(&absolute_url, git_repository_workdir(g_repo)) > 0);
+       cl_git_pass(git_str_joinpath(&absolute_url, absolute_url.ptr, "testrepo.git"));
 
        /* write the absolute url to the .gitmodules file*/
        cl_git_pass(git_submodule_set_url(g_repo, "testrepo", absolute_url.ptr));
@@ -39,7 +39,7 @@ void test_submodule_init__absolute_url(void)
        cl_git_pass(git_config_get_string(&config_url, cfg, "submodule.testrepo.url"));
        cl_assert_equal_s(absolute_url.ptr, config_url);
 
-       git_buf_dispose(&absolute_url);
+       git_str_dispose(&absolute_url);
        git_config_free(cfg);
        git_submodule_free(sm);
 }
@@ -48,13 +48,13 @@ void test_submodule_init__relative_url(void)
 {
        git_submodule *sm;
        git_config *cfg;
-       git_buf absolute_url = GIT_BUF_INIT;
+       git_str absolute_url = GIT_STR_INIT;
        const char *config_url;
 
        g_repo = setup_fixture_submodule_simple();
 
-       cl_assert(git_path_dirname_r(&absolute_url, git_repository_workdir(g_repo)) > 0);
-       cl_git_pass(git_buf_joinpath(&absolute_url, absolute_url.ptr, "testrepo.git"));
+       cl_assert(git_fs_path_dirname_r(&absolute_url, git_repository_workdir(g_repo)) > 0);
+       cl_git_pass(git_str_joinpath(&absolute_url, absolute_url.ptr, "testrepo.git"));
 
        cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
 
@@ -69,7 +69,7 @@ void test_submodule_init__relative_url(void)
        cl_git_pass(git_config_get_string(&config_url, cfg, "submodule.testrepo.url"));
        cl_assert_equal_s(absolute_url.ptr, config_url);
 
-       git_buf_dispose(&absolute_url);
+       git_str_dispose(&absolute_url);
        git_config_free(cfg);
        git_submodule_free(sm);
 }
@@ -78,7 +78,7 @@ void test_submodule_init__relative_url_detached_head(void)
 {
        git_submodule *sm;
        git_config *cfg;
-       git_buf absolute_url = GIT_BUF_INIT;
+       git_str absolute_url = GIT_STR_INIT;
        const char *config_url;
        git_reference *head_ref = NULL;
        git_object *head_commit = NULL;
@@ -91,8 +91,8 @@ void test_submodule_init__relative_url_detached_head(void)
 
        cl_git_pass(git_repository_set_head_detached(g_repo, git_commit_id((git_commit *)head_commit)));
 
-       cl_assert(git_path_dirname_r(&absolute_url, git_repository_workdir(g_repo)) > 0);
-       cl_git_pass(git_buf_joinpath(&absolute_url, absolute_url.ptr, "testrepo.git"));
+       cl_assert(git_fs_path_dirname_r(&absolute_url, git_repository_workdir(g_repo)) > 0);
+       cl_git_pass(git_str_joinpath(&absolute_url, absolute_url.ptr, "testrepo.git"));
 
        cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
 
@@ -107,7 +107,7 @@ void test_submodule_init__relative_url_detached_head(void)
        cl_git_pass(git_config_get_string(&config_url, cfg, "submodule.testrepo.url"));
        cl_assert_equal_s(absolute_url.ptr, config_url);
 
-       git_buf_dispose(&absolute_url);
+       git_str_dispose(&absolute_url);
        git_config_free(cfg);
        git_object_free(head_commit);
        git_reference_free(head_ref);