diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-05-18 10:06:49 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-05-18 10:06:49 +0200 |
commit | 49e369b29d5bde227b162dd4681ecccff2f443df (patch) | |
tree | 30693d4febf21d5bfa2ba2aa1a8a4b31736f5886 /tests/object | |
parent | d7a294633dc6420d2411500bd40c7dfd2aa76d37 (diff) | |
download | libgit2-49e369b29d5bde227b162dd4681ecccff2f443df.tar.gz |
message: don't assume the comment charcmn/comment-char
The comment char is configurable and we need to provide a way for the
user to specify which comment char they chose for their message.
Diffstat (limited to 'tests/object')
-rw-r--r-- | tests/object/commit/commitstagedfile.c | 2 | ||||
-rw-r--r-- | tests/object/message.c | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/object/commit/commitstagedfile.c b/tests/object/commit/commitstagedfile.c index 9758ea9a2..5b48519b8 100644 --- a/tests/object/commit/commitstagedfile.c +++ b/tests/object/commit/commitstagedfile.c @@ -112,7 +112,7 @@ void test_object_commit_commitstagedfile__generate_predictable_object_ids(void) cl_git_pass(git_tree_lookup(&tree, repo, &tree_oid)); memset(&buffer, 0, sizeof(git_buf)); - cl_git_pass(git_message_prettify(&buffer, "Initial commit", 0)); + cl_git_pass(git_message_prettify(&buffer, "Initial commit", 0, '#')); cl_git_pass(git_commit_create_v( &commit_oid, diff --git a/tests/object/message.c b/tests/object/message.c index ab5565341..40d8e7297 100644 --- a/tests/object/message.c +++ b/tests/object/message.c @@ -6,7 +6,7 @@ static void assert_message_prettifying(char *expected_output, char *input, int s { git_buf prettified_message = GIT_BUF_INIT; - git_message_prettify(&prettified_message, input, strip_comments); + git_message_prettify(&prettified_message, input, strip_comments, '#'); cl_assert_equal_s(expected_output, git_buf_cstr(&prettified_message)); git_buf_free(&prettified_message); @@ -175,25 +175,25 @@ void test_object_message__message_prettify(void) git_buf buffer; memset(&buffer, 0, sizeof(buffer)); - cl_git_pass(git_message_prettify(&buffer, "", 0)); + cl_git_pass(git_message_prettify(&buffer, "", 0, '#')); cl_assert_equal_s(buffer.ptr, ""); git_buf_free(&buffer); - cl_git_pass(git_message_prettify(&buffer, "", 1)); + cl_git_pass(git_message_prettify(&buffer, "", 1, '#')); cl_assert_equal_s(buffer.ptr, ""); git_buf_free(&buffer); - cl_git_pass(git_message_prettify(&buffer, "Short", 0)); + cl_git_pass(git_message_prettify(&buffer, "Short", 0, '#')); cl_assert_equal_s("Short\n", buffer.ptr); git_buf_free(&buffer); - cl_git_pass(git_message_prettify(&buffer, "Short", 1)); + cl_git_pass(git_message_prettify(&buffer, "Short", 1, '#')); cl_assert_equal_s("Short\n", buffer.ptr); git_buf_free(&buffer); - cl_git_pass(git_message_prettify(&buffer, "This is longer\nAnd multiline\n# with some comments still in\n", 0)); + cl_git_pass(git_message_prettify(&buffer, "This is longer\nAnd multiline\n# with some comments still in\n", 0, '#')); cl_assert_equal_s(buffer.ptr, "This is longer\nAnd multiline\n# with some comments still in\n"); git_buf_free(&buffer); - cl_git_pass(git_message_prettify(&buffer, "This is longer\nAnd multiline\n# with some comments still in\n", 1)); + cl_git_pass(git_message_prettify(&buffer, "This is longer\nAnd multiline\n# with some comments still in\n", 1, '#')); cl_assert_equal_s(buffer.ptr, "This is longer\nAnd multiline\n"); git_buf_free(&buffer); } |