Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
d91d2968
Commit
d91d2968
authored
Jun 14, 2018
by
Nika Layzell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mailmap: Hide EEXISTS to simplify git_mailmap_add_entry callers
parent
c1a85ae2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
include/git2/mailmap.h
+1
-1
src/mailmap.c
+4
-2
No files found.
include/git2/mailmap.h
View file @
d91d2968
...
...
@@ -47,7 +47,7 @@ GIT_EXTERN(void) git_mailmap_free(git_mailmap *mm);
* @param real_email the real email to use, or NULL
* @param replace_name the name to replace, or NULL
* @param replace_email the email to replace
* @return 0
if it was added, EEXISTS if it replaced an entry
, or an error code
* @return 0
on success
, or an error code
*/
GIT_EXTERN
(
int
)
git_mailmap_add_entry
(
git_mailmap
*
mm
,
const
char
*
real_name
,
const
char
*
real_email
,
...
...
src/mailmap.c
View file @
d91d2968
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment