summaryrefslogtreecommitdiff
path: root/tests/mailmap/parsing.c
diff options
context:
space:
mode:
authorNika Layzell <nika@thelayzells.com>2018-05-07 11:59:00 -0700
committerNika Layzell <nika@thelayzells.com>2018-06-14 22:43:28 -0700
commit56303e1ade453648230115cdaaba8244273f3315 (patch)
tree4f099c741f2b0caf8161e4f3cfdcf670db7bfb74 /tests/mailmap/parsing.c
parenta140c138757e6d4dbcd34a2c68ca34e87cc76238 (diff)
downloadlibgit2-56303e1ade453648230115cdaaba8244273f3315.tar.gz
mailmap: API and style cleanup
Diffstat (limited to 'tests/mailmap/parsing.c')
-rw-r--r--tests/mailmap/parsing.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/mailmap/parsing.c b/tests/mailmap/parsing.c
index 70110c033..2cb830450 100644
--- a/tests/mailmap/parsing.c
+++ b/tests/mailmap/parsing.c
@@ -1,7 +1,7 @@
#include "clar_libgit2.h"
#include "repository.h"
#include "git2/sys/repository.h"
-#include "mailmap_helpers.h"
+#include "mailmap_testdata.h"
#include "buf_text.h"
static git_repository *g_repo;
@@ -67,9 +67,7 @@ static const mailmap_entry resolved_untracked[] = {
void test_mailmap_parsing__string(void)
{
- git_buf buf = GIT_BUF_INIT;
- git_buf_attach_notowned(&buf, string_mailmap, strlen(string_mailmap));
- cl_git_pass(git_mailmap_from_buffer(&g_mailmap, &buf));
+ cl_git_pass(git_mailmap_from_buffer(&g_mailmap, string_mailmap, 0));
/* We should have parsed all of the entries */
check_mailmap_entries(g_mailmap, entries, ARRAY_SIZE(entries));
@@ -89,7 +87,7 @@ void test_mailmap_parsing__windows_string(void)
git_buf_attach_notowned(&unixbuf, string_mailmap, strlen(string_mailmap));
git_buf_text_lf_to_crlf(&winbuf, &unixbuf);
- cl_git_pass(git_mailmap_from_buffer(&g_mailmap, &winbuf));
+ cl_git_pass(git_mailmap_from_buffer(&g_mailmap, winbuf.ptr, winbuf.size));
git_buf_free(&winbuf);
/* We should have parsed all of the entries */