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

Function option_parse_trailer

builtin/interpret-trailers.c:61–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61static int option_parse_trailer(const struct option *opt,
62 const char *arg, int unset)
63{
64 struct list_head *trailers = opt->value;
65 struct new_trailer_item *item;
66
67 if (unset) {
68 new_trailers_clear(trailers);
69 return 0;
70 }
71
72 if (!arg)
73 return -1;
74
75 item = xmalloc(sizeof(*item));
76 item->text = arg;
77 item->where = where;
78 item->if_exists = if_exists;
79 item->if_missing = if_missing;
80 list_add_tail(&item->list, trailers);
81 return 0;
82}
83
84static int parse_opt_parse(const struct option *opt, const char *arg,
85 int unset)

Callers

nothing calls this directly

Calls 3

new_trailers_clearFunction · 0.85
list_add_tailFunction · 0.85
xmallocFunction · 0.50

Tested by

no test coverage detected