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

Function apply_arg_if_missing

trailer.c:315–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313}
314
315static void apply_arg_if_missing(struct list_head *head,
316 struct arg_item *arg_tok)
317{
318 enum trailer_where where;
319 struct trailer_item *to_add;
320
321 switch (arg_tok->conf.if_missing) {
322 case MISSING_DO_NOTHING:
323 free_arg_item(arg_tok);
324 break;
325 case MISSING_ADD:
326 where = arg_tok->conf.where;
327 apply_item_command(NULL, arg_tok);
328 to_add = trailer_from_arg(arg_tok);
329 if (after_or_end(where))
330 list_add_tail(&to_add->list, head);
331 else
332 list_add(&to_add->list, head);
333 break;
334 default:
335 BUG("trailer.c: unhandled value %d",
336 arg_tok->conf.if_missing);
337 }
338}
339
340static int find_same_and_apply_arg(struct list_head *head,
341 struct arg_item *arg_tok)

Callers 1

process_trailers_listsFunction · 0.85

Calls 6

free_arg_itemFunction · 0.85
apply_item_commandFunction · 0.85
trailer_from_argFunction · 0.85
after_or_endFunction · 0.85
list_add_tailFunction · 0.85
list_addFunction · 0.85

Tested by

no test coverage detected