diff options
| author | Nika Layzell <nika@thelayzells.com> | 2018-06-14 16:49:48 -0700 |
|---|---|---|
| committer | Nika Layzell <nika@thelayzells.com> | 2018-06-14 22:43:28 -0700 |
| commit | d91d2968a662ee2b2120c3b44aa6956d9ac57b89 (patch) | |
| tree | 2aecc3a6770aa2fcbb1660568f341a24ccf2a1cf /src/mailmap.c | |
| parent | c1a85ae2ab609ac9d5e9a18c4f644108c8462a43 (diff) | |
| download | libgit2-d91d2968a662ee2b2120c3b44aa6956d9ac57b89.tar.gz | |
mailmap: Hide EEXISTS to simplify git_mailmap_add_entry callers
Diffstat (limited to 'src/mailmap.c')
| -rw-r--r-- | src/mailmap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mailmap.c b/src/mailmap.c index e4b924c05..f249c5261 100644 --- a/src/mailmap.c +++ b/src/mailmap.c @@ -203,7 +203,9 @@ static int mailmap_add_entry_unterminated( GITERR_CHECK_ALLOC(entry->replace_email); error = git_vector_insert_sorted(&mm->entries, entry, mailmap_entry_replace); - if (error < 0 && error != GIT_EEXISTS) + if (error == GIT_EEXISTS) + error = GIT_OK; + else if (error < 0) mailmap_entry_free(entry); return error; @@ -256,7 +258,7 @@ int git_mailmap_add_buffer(git_mailmap *mm, const char *buf, size_t len) error = mailmap_add_entry_unterminated( mm, real_name.ptr, real_name.size, real_email.ptr, real_email.size, replace_name.ptr, replace_name.size, replace_email.ptr, replace_email.size); - if (error < 0 && error != GIT_EEXISTS) + if (error < 0) goto cleanup; error = 0; |
