]> git.proxmox.com Git - libgit2.git/blobdiff - tests/pack/filelimit.c
New upstream version 1.4.3+dfsg.1
[libgit2.git] / tests / pack / filelimit.c
index 5e0b77e9bd2cfd4ad8b2775dcc17ed5374e53bd7..fa08485fb927388d68272131464add3b71c46bab 100644 (file)
@@ -34,12 +34,12 @@ void test_pack_filelimit__initialize_unlimited(void)
 
 void test_pack_filelimit__cleanup(void)
 {
-       git_buf path = GIT_BUF_INIT;
+       git_str path = GIT_STR_INIT;
        cl_git_pass(git_libgit2_opts(GIT_OPT_SET_MWINDOW_FILE_LIMIT, original_mwindow_file_limit));
 
-       cl_git_pass(git_buf_joinpath(&path, clar_sandbox_path(), "repo.git"));
+       cl_git_pass(git_str_joinpath(&path, clar_sandbox_path(), "repo.git"));
        cl_fixture_cleanup(path.ptr);
-       git_buf_dispose(&path);
+       git_str_dispose(&path);
 }
 
 /*
@@ -47,14 +47,14 @@ void test_pack_filelimit__cleanup(void)
  * (README.md) has the same content in all commits, but the second one
  * (file.txt) has a different content in each commit.
  */
-void create_packfile_commit(
+static void create_packfile_commit(
                git_repository *repo,
                git_oid *out_commit_id,
                git_oid *parent_id,
                size_t commit_index,
                size_t commit_count)
 {
-       git_buf file_contents = GIT_BUF_INIT;
+       git_str file_contents = GIT_STR_INIT;
        git_treebuilder *treebuilder;
        git_packbuilder *packbuilder;
        git_signature *s;
@@ -67,7 +67,7 @@ void create_packfile_commit(
        cl_git_pass(git_blob_create_from_buffer(&oid, repo, "", 0));
        cl_git_pass(git_treebuilder_insert(NULL, treebuilder, "README.md", &oid, 0100644));
 
-       cl_git_pass(git_buf_printf(&file_contents, "Commit %zd/%zd", commit_index, commit_count));
+       cl_git_pass(git_str_printf(&file_contents, "Commit %zd/%zd", commit_index, commit_count));
        cl_git_pass(git_blob_create_from_buffer(&oid, repo, file_contents.ptr, file_contents.size));
        cl_git_pass(git_treebuilder_insert(NULL, treebuilder, "file.txt", &oid, 0100644));
 
@@ -82,7 +82,7 @@ void create_packfile_commit(
 
        cl_git_pass(git_oid_cpy(out_commit_id, &commit_id));
 
-       git_buf_dispose(&file_contents);
+       git_str_dispose(&file_contents);
        git_treebuilder_free(treebuilder);
        git_packbuilder_free(packbuilder);
        git_signature_free(s);
@@ -90,7 +90,7 @@ void create_packfile_commit(
 
 void test_pack_filelimit__open_repo_with_multiple_packfiles(void)
 {
-       git_buf path = GIT_BUF_INIT;
+       git_str path = GIT_STR_INIT;
        git_mwindow_ctl *ctl = &git_mwindow__mem_ctl;
        git_repository *repo;
        git_revwalk *walk;
@@ -103,7 +103,7 @@ void test_pack_filelimit__open_repo_with_multiple_packfiles(void)
         * Create a repository and populate it with 16 commits, each in its own
         * packfile.
         */
-       cl_git_pass(git_buf_joinpath(&path, clar_sandbox_path(), "repo.git"));
+       cl_git_pass(git_str_joinpath(&path, clar_sandbox_path(), "repo.git"));
        cl_git_pass(git_repository_init(&repo, path.ptr, true));
        for (i = 0; i < commit_count; ++i) {
                create_packfile_commit(repo, &id, parent_id, i + 1, commit_count);
@@ -130,7 +130,7 @@ void test_pack_filelimit__open_repo_with_multiple_packfiles(void)
 
        cl_assert_equal_i(expected_open_mwindow_files, open_windows);
 
-       git_buf_dispose(&path);
+       git_str_dispose(&path);
        git_revwalk_free(walk);
        git_repository_free(repo);
 }