@@ -31,16 +31,19 @@ struct mailmap_entry {
31
31
static void free_mailmap_info (void * p , const char * s )
32
32
{
33
33
struct mailmap_info * mi = (struct mailmap_info * )p ;
34
- debug_mm ("mailmap: -- complex: '%s' -> '%s' <%s>\n" , s , debug_str (mi -> name ), debug_str (mi -> email ));
34
+ debug_mm ("mailmap: -- complex: '%s' -> '%s' <%s>\n" ,
35
+ s , debug_str (mi -> name ), debug_str (mi -> email ));
35
36
free (mi -> name );
36
37
free (mi -> email );
37
38
}
38
39
39
40
static void free_mailmap_entry (void * p , const char * s )
40
41
{
41
42
struct mailmap_entry * me = (struct mailmap_entry * )p ;
42
- debug_mm ("mailmap: removing entries for <%s>, with %d sub-entries\n" , s , me -> namemap .nr );
43
- debug_mm ("mailmap: - simple: '%s' <%s>\n" , debug_str (me -> name ), debug_str (me -> email ));
43
+ debug_mm ("mailmap: removing entries for <%s>, with %d sub-entries\n" ,
44
+ s , me -> namemap .nr );
45
+ debug_mm ("mailmap: - simple: '%s' <%s>\n" ,
46
+ debug_str (me -> name ), debug_str (me -> email ));
44
47
45
48
free (me -> name );
46
49
free (me -> email );
@@ -50,7 +53,8 @@ static void free_mailmap_entry(void *p, const char *s)
50
53
}
51
54
52
55
static void add_mapping (struct string_list * map ,
53
- char * new_name , char * new_email , char * old_name , char * old_email )
56
+ char * new_name , char * new_email ,
57
+ char * old_name , char * old_email )
54
58
{
55
59
struct mailmap_entry * me ;
56
60
int index ;
@@ -76,7 +80,8 @@ static void add_mapping(struct string_list *map,
76
80
}
77
81
78
82
if (old_name == NULL ) {
79
- debug_mm ("mailmap: adding (simple) entry for %s at index %d\n" , old_email , index );
83
+ debug_mm ("mailmap: adding (simple) entry for %s at index %d\n" ,
84
+ old_email , index );
80
85
/* Replace current name and new email for simple entry */
81
86
if (new_name ) {
82
87
free (me -> name );
@@ -88,7 +93,8 @@ static void add_mapping(struct string_list *map,
88
93
}
89
94
} else {
90
95
struct mailmap_info * mi = xcalloc (1 , sizeof (struct mailmap_info ));
91
- debug_mm ("mailmap: adding (complex) entry for %s at index %d\n" , old_email , index );
96
+ debug_mm ("mailmap: adding (complex) entry for %s at index %d\n" ,
97
+ old_email , index );
92
98
if (new_name )
93
99
mi -> name = xstrdup (new_name );
94
100
if (new_email )
@@ -97,11 +103,12 @@ static void add_mapping(struct string_list *map,
97
103
}
98
104
99
105
debug_mm ("mailmap: '%s' <%s> -> '%s' <%s>\n" ,
100
- debug_str (old_name ), old_email , debug_str (new_name ), debug_str (new_email ));
106
+ debug_str (old_name ), old_email ,
107
+ debug_str (new_name ), debug_str (new_email ));
101
108
}
102
109
103
110
static char * parse_name_and_email (char * buffer , char * * name ,
104
- char * * email , int allow_empty_email )
111
+ char * * email , int allow_empty_email )
105
112
{
106
113
char * left , * right , * nstart , * nend ;
107
114
* name = * email = NULL ;
@@ -305,21 +312,25 @@ static struct string_list_item *lookup_prefix(struct string_list *map,
305
312
}
306
313
307
314
int map_user (struct string_list * map ,
308
- const char * * email , size_t * emaillen ,
309
- const char * * name , size_t * namelen )
315
+ const char * * email , size_t * emaillen ,
316
+ const char * * name , size_t * namelen )
310
317
{
311
318
struct string_list_item * item ;
312
319
struct mailmap_entry * me ;
313
320
314
321
debug_mm ("map_user: map '%.*s' <%.*s>\n" ,
315
- (int )* namelen , debug_str (* name ), (int )* emaillen , debug_str (* email ));
322
+ (int )* namelen , debug_str (* name ),
323
+ (int )* emaillen , debug_str (* email ));
316
324
317
325
item = lookup_prefix (map , * email , * emaillen );
318
326
if (item != NULL ) {
319
327
me = (struct mailmap_entry * )item -> util ;
320
328
if (me -> namemap .nr ) {
321
- /* The item has multiple items, so we'll look up on name too */
322
- /* If the name is not found, we choose the simple entry */
329
+ /*
330
+ * The item has multiple items, so we'll look up on
331
+ * name too. If the name is not found, we choose the
332
+ * simple entry.
333
+ */
323
334
struct string_list_item * subitem ;
324
335
subitem = lookup_prefix (& me -> namemap , * name , * namelen );
325
336
if (subitem )
@@ -340,8 +351,9 @@ int map_user(struct string_list *map,
340
351
* name = mi -> name ;
341
352
* namelen = strlen (* name );
342
353
}
343
- debug_mm ("map_user: to '%.*s' <%.*s>\n" , (int )* namelen , debug_str (* name ),
344
- (int )* emaillen , debug_str (* email ));
354
+ debug_mm ("map_user: to '%.*s' <%.*s>\n" ,
355
+ (int )* namelen , debug_str (* name ),
356
+ (int )* emaillen , debug_str (* email ));
345
357
return 1 ;
346
358
}
347
359
debug_mm ("map_user: --\n" );
0 commit comments