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
57cfeab9
Commit
57cfeab9
authored
Mar 26, 2018
by
Nika Layzell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mailmap: Switch mailmap parsing to use the git_parse module
parent
aa3a24a4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
59 additions
and
122 deletions
+59
-122
include/git2/mailmap.h
+20
-24
src/blame.h
+1
-2
src/mailmap.c
+0
-0
src/signature.c
+7
-32
tests/clar_libgit2.c
+1
-2
tests/mailmap/basic.c
+9
-19
tests/mailmap/blame.c
+3
-6
tests/mailmap/parsing.c
+18
-37
No files found.
include/git2/mailmap.h
View file @
57cfeab9
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
#include "common.h"
#include "common.h"
#include "types.h"
#include "types.h"
#include "buffer.h"
/**
/**
* @file git2/mailmap.h
* @file git2/mailmap.h
...
@@ -35,22 +36,20 @@ typedef struct git_mailmap_entry {
...
@@ -35,22 +36,20 @@ typedef struct git_mailmap_entry {
#define GIT_MAILMAP_ENTRY_INIT {GIT_MAILMAP_ENTRY_VERSION}
#define GIT_MAILMAP_ENTRY_INIT {GIT_MAILMAP_ENTRY_VERSION}
/**
/**
* Create a mailmap object by parsing a mailmap file.
* Create a mailmap object by parsing a mailmap file. Malformed entries in the
* mailmap are ignored.
*
*
* The mailmap must be freed with 'git_mailmap_free'.
* The mailmap must be freed with 'git_mailmap_free'.
*
*
* @param out pointer to store the mailmap
* @param out pointer to store the mailmap
* @param data raw data buffer to parse
* @param buffer buffer to parse the mailmap from
* @param size size of the raw data buffer
* @return 0 on success, otherwise an error code
* @return 0 on success
*/
*/
GIT_EXTERN
(
int
)
git_mailmap_parse
(
GIT_EXTERN
(
int
)
git_mailmap_from_buffer
(
git_mailmap
**
out
,
git_buf
*
buffer
);
git_mailmap
**
out
,
const
char
*
data
,
size_t
size
);
/**
/**
* Create a mailmap object from the given repository.
* Create a mailmap object from the given repository. Malformed entries in the
* mailmap are ignored.
*
*
* If the repository is not bare, the repository's working directory root will
* If the repository is not bare, the repository's working directory root will
* be checked for the '.mailmap' file to be parsed.
* be checked for the '.mailmap' file to be parsed.
...
@@ -62,20 +61,23 @@ GIT_EXTERN(int) git_mailmap_parse(
...
@@ -62,20 +61,23 @@ GIT_EXTERN(int) git_mailmap_parse(
*
*
* @param out pointer to store the mailmap
* @param out pointer to store the mailmap
* @param repo repository to find the .mailmap in
* @param repo repository to find the .mailmap in
* @return 0 on success; GIT_ENOTFOUND if .mailmap could not be found.
* @return 0 on success; GIT_ENOTFOUND if .mailmap could not be found,
* otherwise an error code.
*/
*/
GIT_EXTERN
(
int
)
git_mailmap_from_repo
(
GIT_EXTERN
(
int
)
git_mailmap_from_repo
(
git_mailmap
**
out
,
git_repository
*
repo
);
git_mailmap
**
out
,
git_repository
*
repo
);
/**
/**
* Free a mailmap created by 'git_mailmap_parse' or 'git_mailmap_from_repo'.
* Free a mailmap created by 'git_mailmap_from_buffer' or
* 'git_mailmap_from_repo'.
*/
*/
GIT_EXTERN
(
void
)
git_mailmap_free
(
git_mailmap
*
mailmap
);
GIT_EXTERN
(
void
)
git_mailmap_free
(
git_mailmap
*
mailmap
);
/**
/**
* Resolve a name and email to the corresponding real name and email.
* Resolve a name and email to the corresponding real name and email.
*
*
* The lifetime of the string results is tied to the `mailmap`, `name`, and
* `email` parameters.
*
* @param name_out either 'name', or the real name to use.
* @param name_out either 'name', or the real name to use.
* You should NOT free this value.
* You should NOT free this value.
* @param email_out either 'email' or the real email to use,
* @param email_out either 'email' or the real email to use,
...
@@ -85,11 +87,8 @@ GIT_EXTERN(void) git_mailmap_free(git_mailmap *mailmap);
...
@@ -85,11 +87,8 @@ GIT_EXTERN(void) git_mailmap_free(git_mailmap *mailmap);
* @param email the email to resolve.
* @param email the email to resolve.
*/
*/
GIT_EXTERN
(
void
)
git_mailmap_resolve
(
GIT_EXTERN
(
void
)
git_mailmap_resolve
(
const
char
**
name_out
,
const
char
**
name_out
,
const
char
**
email_out
,
const
char
**
email_out
,
const
git_mailmap
*
mailmap
,
const
char
*
name
,
const
char
*
email
);
const
git_mailmap
*
mailmap
,
const
char
*
name
,
const
char
*
email
);
/**
/**
* Get the number of mailmap entries in this mailmap.
* Get the number of mailmap entries in this mailmap.
...
@@ -104,8 +103,7 @@ GIT_EXTERN(size_t) git_mailmap_entry_count(const git_mailmap *mailmap);
...
@@ -104,8 +103,7 @@ GIT_EXTERN(size_t) git_mailmap_entry_count(const git_mailmap *mailmap);
* @return the mailmap entry at index, or NULL if it cannot be found.
* @return the mailmap entry at index, or NULL if it cannot be found.
*/
*/
GIT_EXTERN
(
const
git_mailmap_entry
*
)
git_mailmap_entry_byindex
(
GIT_EXTERN
(
const
git_mailmap_entry
*
)
git_mailmap_entry_byindex
(
const
git_mailmap
*
mailmap
,
const
git_mailmap
*
mailmap
,
size_t
idx
);
size_t
idx
);
/**
/**
* Lookup a mailmap entry by name/email pair.
* Lookup a mailmap entry by name/email pair.
...
@@ -118,9 +116,7 @@ GIT_EXTERN(const git_mailmap_entry *) git_mailmap_entry_byindex(
...
@@ -118,9 +116,7 @@ GIT_EXTERN(const git_mailmap_entry *) git_mailmap_entry_byindex(
* @return the corresponding mailmap entry, or NULL if it cannot be found.
* @return the corresponding mailmap entry, or NULL if it cannot be found.
*/
*/
GIT_EXTERN
(
const
git_mailmap_entry
*
)
git_mailmap_entry_lookup
(
GIT_EXTERN
(
const
git_mailmap_entry
*
)
git_mailmap_entry_lookup
(
const
git_mailmap
*
mailmap
,
const
git_mailmap
*
mailmap
,
const
char
*
name
,
const
char
*
email
);
const
char
*
name
,
const
char
*
email
);
/** @} */
/** @} */
GIT_END_DECL
GIT_END_DECL
...
...
src/blame.h
View file @
57cfeab9
...
@@ -67,6 +67,7 @@ typedef struct git_blame__entry {
...
@@ -67,6 +67,7 @@ typedef struct git_blame__entry {
struct
git_blame
{
struct
git_blame
{
char
*
path
;
char
*
path
;
git_repository
*
repository
;
git_repository
*
repository
;
git_mailmap
*
mailmap
;
git_blame_options
options
;
git_blame_options
options
;
git_vector
hunks
;
git_vector
hunks
;
...
@@ -84,8 +85,6 @@ struct git_blame {
...
@@ -84,8 +85,6 @@ struct git_blame {
int
num_lines
;
int
num_lines
;
const
char
*
final_buf
;
const
char
*
final_buf
;
git_off_t
final_buf_size
;
git_off_t
final_buf_size
;
git_mailmap
*
mailmap
;
};
};
git_blame
*
git_blame__alloc
(
git_blame
*
git_blame__alloc
(
...
...
src/mailmap.c
View file @
57cfeab9
This diff is collapsed.
Click to expand it.
src/signature.c
View file @
57cfeab9
...
@@ -99,27 +99,8 @@ int git_signature_new(git_signature **sig_out, const char *name, const char *ema
...
@@ -99,27 +99,8 @@ int git_signature_new(git_signature **sig_out, const char *name, const char *ema
int
git_signature_dup
(
git_signature
**
dest
,
const
git_signature
*
source
)
int
git_signature_dup
(
git_signature
**
dest
,
const
git_signature
*
source
)
{
{
git_signature
*
signature
;
/* If mailmap is NULL, this method just copies the signature */
return
git_signature_with_mailmap
(
dest
,
source
,
NULL
);
if
(
source
==
NULL
)
return
0
;
signature
=
git__calloc
(
1
,
sizeof
(
git_signature
));
GITERR_CHECK_ALLOC
(
signature
);
signature
->
name
=
git__strdup
(
source
->
name
);
GITERR_CHECK_ALLOC
(
signature
->
name
);
signature
->
email
=
git__strdup
(
source
->
email
);
GITERR_CHECK_ALLOC
(
signature
->
email
);
signature
->
when
.
time
=
source
->
when
.
time
;
signature
->
when
.
offset
=
source
->
when
.
offset
;
signature
->
when
.
sign
=
source
->
when
.
sign
;
*
dest
=
signature
;
return
0
;
}
}
int
git_signature_with_mailmap
(
int
git_signature_with_mailmap
(
...
@@ -132,32 +113,26 @@ int git_signature_with_mailmap(
...
@@ -132,32 +113,26 @@ int git_signature_with_mailmap(
const
char
*
email
=
NULL
;
const
char
*
email
=
NULL
;
if
(
source
==
NULL
)
if
(
source
==
NULL
)
goto
on_error
;
return
0
;
git_mailmap_resolve
(
&
name
,
&
email
,
mailmap
,
source
->
name
,
source
->
email
);
git_mailmap_resolve
(
&
name
,
&
email
,
mailmap
,
source
->
name
,
source
->
email
);
signature
=
git__calloc
(
1
,
sizeof
(
git_signature
));
signature
=
git__calloc
(
1
,
sizeof
(
git_signature
));
if
(
!
signature
)
GITERR_CHECK_ALLOC
(
signature
);
goto
on_error
;
signature
->
name
=
git__strdup
(
name
);
signature
->
name
=
git__strdup
(
name
);
if
(
!
signature
->
name
)
GITERR_CHECK_ALLOC
(
signature
->
name
);
goto
on_error
;
signature
->
email
=
git__strdup
(
email
);
signature
->
email
=
git__strdup
(
email
);
if
(
!
signature
->
email
)
GITERR_CHECK_ALLOC
(
signature
->
email
);
goto
on_error
;
signature
->
when
.
time
=
source
->
when
.
time
;
signature
->
when
.
time
=
source
->
when
.
time
;
signature
->
when
.
offset
=
source
->
when
.
offset
;
signature
->
when
.
offset
=
source
->
when
.
offset
;
signature
->
when
.
sign
=
source
->
when
.
sign
;
signature
->
when
.
sign
=
source
->
when
.
sign
;
*
dest
=
signature
;
*
dest
=
signature
;
return
0
;
on_error:
return
0
;
git_signature_free
(
signature
);
return
-
1
;
}
}
int
git_signature__pdup
(
git_signature
**
dest
,
const
git_signature
*
source
,
git_pool
*
pool
)
int
git_signature__pdup
(
git_signature
**
dest
,
const
git_signature
*
source
,
git_pool
*
pool
)
...
...
tests/clar_libgit2.c
View file @
57cfeab9
...
@@ -227,8 +227,7 @@ git_repository *cl_git_sandbox_reopen(void)
...
@@ -227,8 +227,7 @@ git_repository *cl_git_sandbox_reopen(void)
_cl_repo
=
NULL
;
_cl_repo
=
NULL
;
cl_git_pass
(
git_repository_open
(
cl_git_pass
(
git_repository_open
(
&
_cl_repo
,
&
_cl_repo
,
cl_fixture_basename
(
_cl_sandbox
)));
cl_fixture_basename
(
_cl_sandbox
)));
}
}
return
_cl_repo
;
return
_cl_repo
;
...
...
tests/mailmap/basic.c
View file @
57cfeab9
...
@@ -15,7 +15,10 @@ const char TEST_MAILMAP[] =
...
@@ -15,7 +15,10 @@ const char TEST_MAILMAP[] =
void
test_mailmap_basic__initialize
(
void
)
void
test_mailmap_basic__initialize
(
void
)
{
{
cl_git_pass
(
git_mailmap_parse
(
&
mailmap
,
TEST_MAILMAP
,
sizeof
(
TEST_MAILMAP
)
-
1
));
git_buf
buf
=
GIT_BUF_INIT
;
git_buf_attach_notowned
(
&
buf
,
TEST_MAILMAP
,
sizeof
(
TEST_MAILMAP
)
-
1
);
cl_git_pass
(
git_mailmap_from_buffer
(
&
mailmap
,
&
buf
));
}
}
void
test_mailmap_basic__cleanup
(
void
)
void
test_mailmap_basic__cleanup
(
void
)
...
@@ -53,9 +56,7 @@ void test_mailmap_basic__lookup_not_found(void)
...
@@ -53,9 +56,7 @@ void test_mailmap_basic__lookup_not_found(void)
void
test_mailmap_basic__lookup
(
void
)
void
test_mailmap_basic__lookup
(
void
)
{
{
const
git_mailmap_entry
*
entry
=
git_mailmap_entry_lookup
(
const
git_mailmap_entry
*
entry
=
git_mailmap_entry_lookup
(
mailmap
,
mailmap
,
"Typoed the name once"
,
"foo@baz.com"
);
"Typoed the name once"
,
"foo@baz.com"
);
cl_assert
(
entry
);
cl_assert
(
entry
);
cl_assert
(
!
git__strcmp
(
entry
->
real_name
,
"Foo bar"
));
cl_assert
(
!
git__strcmp
(
entry
->
real_name
,
"Foo bar"
));
}
}
...
@@ -65,11 +66,7 @@ void test_mailmap_basic__empty_email_query(void)
...
@@ -65,11 +66,7 @@ void test_mailmap_basic__empty_email_query(void)
const
char
*
name
;
const
char
*
name
;
const
char
*
email
;
const
char
*
email
;
git_mailmap_resolve
(
git_mailmap_resolve
(
&
name
,
&
name
,
&
email
,
mailmap
,
"Author name"
,
"otheremail@foo.com"
);
&
email
,
mailmap
,
"Author name"
,
"otheremail@foo.com"
);
cl_assert
(
!
git__strcmp
(
name
,
"Author name"
));
cl_assert
(
!
git__strcmp
(
name
,
"Author name"
));
cl_assert
(
!
git__strcmp
(
email
,
"email@foo.com"
));
cl_assert
(
!
git__strcmp
(
email
,
"email@foo.com"
));
}
}
...
@@ -79,20 +76,13 @@ void test_mailmap_basic__name_matching(void)
...
@@ -79,20 +76,13 @@ void test_mailmap_basic__name_matching(void)
const
char
*
name
;
const
char
*
name
;
const
char
*
email
;
const
char
*
email
;
git_mailmap_resolve
(
git_mailmap_resolve
(
&
name
,
&
name
,
&
email
,
mailmap
,
"Other Name"
,
"yetanotheremail@foo.com"
);
&
email
,
mailmap
,
"Other Name"
,
"yetanotheremail@foo.com"
);
cl_assert
(
!
git__strcmp
(
name
,
"Other Name"
));
cl_assert
(
!
git__strcmp
(
name
,
"Other Name"
));
cl_assert
(
!
git__strcmp
(
email
,
"email@foo.com"
));
cl_assert
(
!
git__strcmp
(
email
,
"email@foo.com"
));
git_mailmap_resolve
(
git_mailmap_resolve
(
&
name
,
&
name
,
&
email
,
mailmap
,
&
email
,
"Other Name That Doesn't Match"
,
"yetanotheremail@foo.com"
);
mailmap
,
"Other Name That Doesn't Match"
,
"yetanotheremail@foo.com"
);
cl_assert
(
!
git__strcmp
(
name
,
"Other Name That Doesn't Match"
));
cl_assert
(
!
git__strcmp
(
name
,
"Other Name That Doesn't Match"
));
cl_assert
(
!
git__strcmp
(
email
,
"yetanotheremail@foo.com"
));
cl_assert
(
!
git__strcmp
(
email
,
"yetanotheremail@foo.com"
));
}
}
tests/mailmap/blame.c
View file @
57cfeab9
...
@@ -15,11 +15,8 @@ void test_mailmap_blame__initialize(void)
...
@@ -15,11 +15,8 @@ void test_mailmap_blame__initialize(void)
void
test_mailmap_blame__cleanup
(
void
)
void
test_mailmap_blame__cleanup
(
void
)
{
{
cl_git_sandbox_cleanup
();
g_repo
=
NULL
;
git_blame_free
(
g_blame
);
git_blame_free
(
g_blame
);
g_blame
=
NULL
;
cl_git_sandbox_cleanup
()
;
}
}
void
test_mailmap_blame__hunks
(
void
)
void
test_mailmap_blame__hunks
(
void
)
...
@@ -32,7 +29,7 @@ void test_mailmap_blame__hunks(void)
...
@@ -32,7 +29,7 @@ void test_mailmap_blame__hunks(void)
opts
.
flags
|=
GIT_BLAME_USE_MAILMAP
;
opts
.
flags
|=
GIT_BLAME_USE_MAILMAP
;
cl_
check
_pass
(
git_blame_file
(
&
g_blame
,
g_repo
,
"file.txt"
,
&
opts
));
cl_
git
_pass
(
git_blame_file
(
&
g_blame
,
g_repo
,
"file.txt"
,
&
opts
));
if
(
!
g_blame
)
if
(
!
g_blame
)
return
;
return
;
...
@@ -54,7 +51,7 @@ void test_mailmap_blame__hunks_no_mailmap(void)
...
@@ -54,7 +51,7 @@ void test_mailmap_blame__hunks_no_mailmap(void)
g_repo
=
cl_git_sandbox_init
(
"mailmap"
);
g_repo
=
cl_git_sandbox_init
(
"mailmap"
);
cl_
check
_pass
(
git_blame_file
(
&
g_blame
,
g_repo
,
"file.txt"
,
&
opts
));
cl_
git
_pass
(
git_blame_file
(
&
g_blame
,
g_repo
,
"file.txt"
,
&
opts
));
if
(
!
g_blame
)
if
(
!
g_blame
)
return
;
return
;
...
...
tests/mailmap/parsing.c
View file @
57cfeab9
...
@@ -14,18 +14,15 @@ void test_mailmap_parsing__initialize(void)
...
@@ -14,18 +14,15 @@ void test_mailmap_parsing__initialize(void)
void
test_mailmap_parsing__cleanup
(
void
)
void
test_mailmap_parsing__cleanup
(
void
)
{
{
cl_git_sandbox_cleanup
();
g_repo
=
NULL
;
git_mailmap_free
(
g_mailmap
);
git_mailmap_free
(
g_mailmap
);
g_mailmap
=
NULL
;
cl_git_sandbox_cleanup
()
;
}
}
static
void
check_mailmap_entries
(
static
void
check_mailmap_entries
(
const
git_mailmap
*
mailmap
,
const
mailmap_entry
*
entries
,
size_t
entries_size
)
const
git_mailmap
*
mailmap
,
const
mailmap_entry
*
entries
,
size_t
entries_size
)
{
{
const
git_mailmap_entry
*
parsed
=
NULL
;
const
git_mailmap_entry
*
parsed
=
NULL
;
size_t
idx
=
0
;
size_t
idx
;
/* Check that the parsed entries match */
/* Check that the parsed entries match */
cl_assert_equal_sz
(
entries_size
,
git_mailmap_entry_count
(
mailmap
));
cl_assert_equal_sz
(
entries_size
,
git_mailmap_entry_count
(
mailmap
));
...
@@ -43,7 +40,7 @@ static void check_mailmap_resolve(
...
@@ -43,7 +40,7 @@ static void check_mailmap_resolve(
{
{
const
char
*
resolved_name
=
NULL
;
const
char
*
resolved_name
=
NULL
;
const
char
*
resolved_email
=
NULL
;
const
char
*
resolved_email
=
NULL
;
size_t
idx
=
0
;
size_t
idx
;
/* Check that the resolver behaves correctly */
/* Check that the resolver behaves correctly */
for
(
idx
=
0
;
idx
<
resolved_size
;
++
idx
)
{
for
(
idx
=
0
;
idx
<
resolved_size
;
++
idx
)
{
...
@@ -60,23 +57,17 @@ static void check_mailmap_resolve(
...
@@ -60,23 +57,17 @@ static void check_mailmap_resolve(
void
test_mailmap_parsing__string
(
void
)
void
test_mailmap_parsing__string
(
void
)
{
{
cl_check_pass
(
git_mailmap_parse
(
git_buf
buf
=
GIT_BUF_INIT
;
&
g_mailmap
,
git_buf_attach_notowned
(
&
buf
,
string_mailmap
,
strlen
(
string_mailmap
));
string_mailmap
,
cl_git_pass
(
git_mailmap_from_buffer
(
&
g_mailmap
,
&
buf
));
strlen
(
string_mailmap
)));
/* We should have parsed all of the entries */
/* We should have parsed all of the entries */
check_mailmap_entries
(
check_mailmap_entries
(
g_mailmap
,
entries
,
ARRAY_SIZE
(
entries
));
g_mailmap
,
entries
,
ARRAY_SIZE
(
entries
));
/* Check that resolving the entries works */
/* Check that resolving the entries works */
check_mailmap_resolve
(
g_mailmap
,
resolved
,
ARRAY_SIZE
(
resolved
));
check_mailmap_resolve
(
check_mailmap_resolve
(
g_mailmap
,
g_mailmap
,
resolved_untracked
,
ARRAY_SIZE
(
resolved_untracked
));
resolved
,
ARRAY_SIZE
(
resolved
));
check_mailmap_resolve
(
g_mailmap
,
resolved_untracked
,
ARRAY_SIZE
(
resolved_untracked
));
}
}
void
test_mailmap_parsing__fromrepo
(
void
)
void
test_mailmap_parsing__fromrepo
(
void
)
...
@@ -84,40 +75,30 @@ void test_mailmap_parsing__fromrepo(void)
...
@@ -84,40 +75,30 @@ void test_mailmap_parsing__fromrepo(void)
g_repo
=
cl_git_sandbox_init
(
"mailmap"
);
g_repo
=
cl_git_sandbox_init
(
"mailmap"
);
cl_check
(
!
git_repository_is_bare
(
g_repo
));
cl_check
(
!
git_repository_is_bare
(
g_repo
));
cl_
check
_pass
(
git_mailmap_from_repo
(
&
g_mailmap
,
g_repo
));
cl_
git
_pass
(
git_mailmap_from_repo
(
&
g_mailmap
,
g_repo
));
/* We should have parsed all of the entries */
/* We should have parsed all of the entries */
check_mailmap_entries
(
check_mailmap_entries
(
g_mailmap
,
entries
,
ARRAY_SIZE
(
entries
));
g_mailmap
,
entries
,
ARRAY_SIZE
(
entries
));
/* Check that resolving the entries works */
/* Check that resolving the entries works */
check_mailmap_resolve
(
g_mailmap
,
resolved
,
ARRAY_SIZE
(
resolved
));
check_mailmap_resolve
(
check_mailmap_resolve
(
g_mailmap
,
g_mailmap
,
resolved_untracked
,
ARRAY_SIZE
(
resolved_untracked
));
resolved
,
ARRAY_SIZE
(
resolved
));
check_mailmap_resolve
(
g_mailmap
,
resolved_untracked
,
ARRAY_SIZE
(
resolved_untracked
));
}
}
void
test_mailmap_parsing__frombare
(
void
)
void
test_mailmap_parsing__frombare
(
void
)
{
{
g_repo
=
cl_git_sandbox_init
(
"mailmap/.gitted"
);
g_repo
=
cl_git_sandbox_init
(
"mailmap/.gitted"
);
cl_
check
_pass
(
git_repository_set_bare
(
g_repo
));
cl_
git
_pass
(
git_repository_set_bare
(
g_repo
));
cl_check
(
git_repository_is_bare
(
g_repo
));
cl_check
(
git_repository_is_bare
(
g_repo
));
cl_
check
_pass
(
git_mailmap_from_repo
(
&
g_mailmap
,
g_repo
));
cl_
git
_pass
(
git_mailmap_from_repo
(
&
g_mailmap
,
g_repo
));
/* We should have parsed all of the entries, except for the untracked one */
/* We should have parsed all of the entries, except for the untracked one */
check_mailmap_entries
(
check_mailmap_entries
(
g_mailmap
,
entries
,
ARRAY_SIZE
(
entries
)
-
1
);
g_mailmap
,
entries
,
ARRAY_SIZE
(
entries
)
-
1
);
/* Check that resolving the entries works */
/* Check that resolving the entries works */
check_mailmap_resolve
(
g_mailmap
,
resolved
,
ARRAY_SIZE
(
resolved
));
check_mailmap_resolve
(
check_mailmap_resolve
(
g_mailmap
,
g_mailmap
,
resolved_bare
,
ARRAY_SIZE
(
resolved_bare
));
resolved
,
ARRAY_SIZE
(
resolved
));
check_mailmap_resolve
(
g_mailmap
,
resolved_bare
,
ARRAY_SIZE
(
resolved_bare
));
}
}
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