diff options
| author | Nika Layzell <nika@thelayzells.com> | 2018-03-17 18:24:15 -0400 |
|---|---|---|
| committer | Nika Layzell <nika@thelayzells.com> | 2018-06-14 22:43:27 -0700 |
| commit | 4ff44be8ce36b345340eea962d9df8a595c1c0bf (patch) | |
| tree | 8cbd47f5e47742140afc3ca168c19b54fd1b1544 | |
| parent | 983b8c2df818c92afa9b15041d3480b671b59a14 (diff) | |
| download | libgit2-4ff44be8ce36b345340eea962d9df8a595c1c0bf.tar.gz | |
mailmap: Fix more bugs which snuck in when I rebased
| -rw-r--r-- | include/git2/mailmap.h | 4 | ||||
| -rw-r--r-- | src/blame.c | 1 | ||||
| -rw-r--r-- | src/mailmap.c | 4 | ||||
| -rw-r--r-- | tests/mailmap/basic.c | 8 | ||||
| -rw-r--r-- | tests/mailmap/blame.c | 1 | ||||
| -rw-r--r-- | tests/mailmap/parsing.c | 2 |
6 files changed, 10 insertions, 10 deletions
diff --git a/include/git2/mailmap.h b/include/git2/mailmap.h index a80ecb970..0c722b549 100644 --- a/include/git2/mailmap.h +++ b/include/git2/mailmap.h @@ -22,14 +22,14 @@ GIT_BEGIN_DECL /** * A single entry parsed from a mailmap. */ -struct git_mailmap_entry { +typedef struct git_mailmap_entry { unsigned int version; const char *real_name; /**< the real name (may be NULL) */ const char *real_email; /**< the real email (may be NULL) */ const char *replace_name; /**< the name to replace (may be NULL) */ const char *replace_email; /**< the email to replace */ -}; +} git_mailmap_entry; #define GIT_MAILMAP_ENTRY_VERSION 1 #define GIT_MAILMAP_ENTRY_INIT {GIT_MAILMAP_ENTRY_VERSION} diff --git a/src/blame.c b/src/blame.c index 967530b7e..0624bf4f6 100644 --- a/src/blame.c +++ b/src/blame.c @@ -14,6 +14,7 @@ #include "git2/diff.h" #include "git2/blob.h" #include "git2/signature.h" +#include "git2/mailmap.h" #include "util.h" #include "repository.h" #include "blame_git.h" diff --git a/src/mailmap.c b/src/mailmap.c index aaf5446f2..c0da98d48 100644 --- a/src/mailmap.c +++ b/src/mailmap.c @@ -215,7 +215,7 @@ int git_mailmap_parse( cleanup: git__free(entry); - if (error < 0) + if (error < 0) { git_mailmap_free(*mailmap); *mailmap = NULL; } @@ -317,7 +317,7 @@ static int git_mailmap_from_bare_repo( error = git_object_lookup_bypath( (git_object **) &blob, - treeish, + tree, ".mailmap", GIT_OBJ_BLOB); if (error < 0) diff --git a/tests/mailmap/basic.c b/tests/mailmap/basic.c index b507407a5..10fc30bdd 100644 --- a/tests/mailmap/basic.c +++ b/tests/mailmap/basic.c @@ -15,7 +15,7 @@ const char TEST_MAILMAP[] = void test_mailmap_basic__initialize(void) { - cl_git_pass(git_mailmap_parse(&mailmap, TEST_MAILMAP, sizeof(TEST_MAILMAP))); + cl_git_pass(git_mailmap_parse(&mailmap, TEST_MAILMAP, sizeof(TEST_MAILMAP) - 1)); } void test_mailmap_basic__cleanup(void) @@ -28,7 +28,7 @@ void test_mailmap_basic__cleanup(void) void test_mailmap_basic__entry(void) { - git_mailmap_entry* entry; + const git_mailmap_entry* entry; cl_assert(git_mailmap_entry_count(mailmap) == 4); @@ -43,7 +43,7 @@ void test_mailmap_basic__entry(void) void test_mailmap_basic__lookup_not_found(void) { - git_mailmap_entry* entry = git_mailmap_entry_lookup( + const git_mailmap_entry* entry = git_mailmap_entry_lookup( mailmap, "Whoever", "doesnotexist@fo.com"); @@ -52,7 +52,7 @@ void test_mailmap_basic__lookup_not_found(void) void test_mailmap_basic__lookup(void) { - git_mailmap_entry* entry = git_mailmap_entry_lookup( + const git_mailmap_entry* entry = git_mailmap_entry_lookup( mailmap, "Typoed the name once", "foo@baz.com"); diff --git a/tests/mailmap/blame.c b/tests/mailmap/blame.c index 2dd309588..45e9812a8 100644 --- a/tests/mailmap/blame.c +++ b/tests/mailmap/blame.c @@ -6,7 +6,6 @@ static git_repository *g_repo; static git_blame *g_blame; -static git_mailmap *g_mailmap; void test_mailmap_blame__initialize(void) { diff --git a/tests/mailmap/parsing.c b/tests/mailmap/parsing.c index 3fda25ff7..a81f2f9bf 100644 --- a/tests/mailmap/parsing.c +++ b/tests/mailmap/parsing.c @@ -24,7 +24,7 @@ void test_mailmap_parsing__cleanup(void) static void check_mailmap_entries( const git_mailmap *mailmap, const mailmap_entry *entries, size_t entries_size) { - const mailmap_entry *parsed = NULL; + const git_mailmap_entry *parsed = NULL; size_t idx = 0; /* Check that the parsed entries match */ |
