MCPcopy Index your code
hub / github.com/git/git / map_user

Function map_user

mailmap.c:296–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296int map_user(struct string_list *map,
297 const char **email, size_t *emaillen,
298 const char **name, size_t *namelen)
299{
300 struct string_list_item *item;
301 struct mailmap_entry *me;
302
303 item = lookup_prefix(map, *email, *emaillen);
304 if (item) {
305 me = (struct mailmap_entry *)item->util;
306 if (me->namemap.nr) {
307 /*
308 * The item has multiple items, so we'll look up on
309 * name too. If the name is not found, we choose the
310 * simple entry.
311 */
312 struct string_list_item *subitem;
313 subitem = lookup_prefix(&me->namemap, *name, *namelen);
314 if (subitem)
315 item = subitem;
316 }
317 }
318 if (item) {
319 struct mailmap_info *mi = (struct mailmap_info *)item->util;
320 if (mi->name == NULL && mi->email == NULL)
321 return 0;
322 if (mi->email) {
323 *email = mi->email;
324 *emaillen = strlen(*email);
325 }
326 if (mi->name) {
327 *name = mi->name;
328 *namelen = strlen(*name);
329 }
330 return 1;
331 }
332 return 0;
333}

Callers 6

rewrite_ident_lineFunction · 0.85
pp_user_infoFunction · 0.85
mailmap_nameFunction · 0.85
check_mailmapFunction · 0.85
get_ac_lineFunction · 0.85
parse_identFunction · 0.85

Calls 1

lookup_prefixFunction · 0.85

Tested by

no test coverage detected