Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/object/commit/commitstagedfile.c')
-rw-r--r--tests/object/commit/commitstagedfile.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/object/commit/commitstagedfile.c b/tests/object/commit/commitstagedfile.c
index 9867ab418..fbeeccbbd 100644
--- a/tests/object/commit/commitstagedfile.c
+++ b/tests/object/commit/commitstagedfile.c
@@ -25,7 +25,7 @@ void test_object_commit_commitstagedfile__generate_predictable_object_ids(void)
git_oid expected_blob_oid, tree_oid, expected_tree_oid, commit_oid, expected_commit_oid;
git_signature *signature;
git_tree *tree;
- char buffer[128];
+ git_buf buffer;
/*
* The test below replicates the following git scenario
@@ -77,7 +77,7 @@ void test_object_commit_commitstagedfile__generate_predictable_object_ids(void)
entry = git_index_get_byindex(index, 0);
- cl_assert(git_oid_cmp(&expected_blob_oid, &entry->oid) == 0);
+ cl_assert(git_oid_cmp(&expected_blob_oid, &entry->id) == 0);
/*
* Information about index entry should match test file
@@ -111,7 +111,8 @@ void test_object_commit_commitstagedfile__generate_predictable_object_ids(void)
cl_git_pass(git_signature_new(&signature, "nulltoken", "emeric.fermas@gmail.com", 1323847743, 60));
cl_git_pass(git_tree_lookup(&tree, repo, &tree_oid));
- cl_assert_equal_i(16, git_message_prettify(buffer, 128, "Initial commit", 0));
+ memset(&buffer, 0, sizeof(git_buf));
+ cl_git_pass(git_message_prettify(&buffer, "Initial commit", 0));
cl_git_pass(git_commit_create_v(
&commit_oid,
@@ -120,12 +121,13 @@ void test_object_commit_commitstagedfile__generate_predictable_object_ids(void)
signature,
signature,
NULL,
- buffer,
+ buffer.ptr,
tree,
0));
cl_assert(git_oid_cmp(&expected_commit_oid, &commit_oid) == 0);
+ git_buf_free(&buffer);
git_signature_free(signature);
git_tree_free(tree);
git_index_free(index);