MCPcopy Create free account
hub / github.com/git/git / get_conf_item

Function get_conf_item

trailer.c:447–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445}
446
447static struct arg_item *get_conf_item(const char *name)
448{
449 struct list_head *pos;
450 struct arg_item *item;
451
452 /* Look up item with same name */
453 list_for_each(pos, &conf_head) {
454 item = list_entry(pos, struct arg_item, list);
455 if (!strcasecmp(item->conf.name, name))
456 return item;
457 }
458
459 /* Item does not already exists, create it */
460 CALLOC_ARRAY(item, 1);
461 duplicate_conf(&item->conf, &default_conf_info);
462 item->conf.name = xstrdup(name);
463
464 list_add_tail(&item->list, &conf_head);
465
466 return item;
467}
468
469enum trailer_info_type { TRAILER_KEY, TRAILER_COMMAND, TRAILER_CMD,
470 TRAILER_WHERE, TRAILER_IF_EXISTS, TRAILER_IF_MISSING };

Callers 1

git_trailer_configFunction · 0.85

Calls 3

duplicate_confFunction · 0.85
xstrdupFunction · 0.85
list_add_tailFunction · 0.85

Tested by

no test coverage detected