Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mailmap.c')
-rw-r--r--mailmap.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mailmap.c b/mailmap.c
index 7ac966107e..d1f7c0d272 100644
--- a/mailmap.c
+++ b/mailmap.c
@@ -83,7 +83,7 @@ static void add_mapping(struct string_list *map,
if (item->util) {
me = (struct mailmap_entry *)item->util;
} else {
- me = xcalloc(1, sizeof(struct mailmap_entry));
+ CALLOC_ARRAY(me, 1);
me->namemap.strdup_strings = 1;
me->namemap.cmp = namemap_cmp;
item->util = me;
@@ -235,9 +235,10 @@ int read_mailmap(struct string_list *map)
if (!git_mailmap_blob && is_bare_repository())
git_mailmap_blob = "HEAD:.mailmap";
- err |= read_mailmap_file(map, ".mailmap",
- startup_info->have_repository ?
- MAILMAP_NOFOLLOW : 0);
+ if (!startup_info->have_repository || !is_bare_repository())
+ err |= read_mailmap_file(map, ".mailmap",
+ startup_info->have_repository ?
+ MAILMAP_NOFOLLOW : 0);
if (startup_info->have_repository)
err |= read_mailmap_blob(map, git_mailmap_blob);
err |= read_mailmap_file(map, git_mailmap_file, 0);