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

Function option_parse_missing_action

builtin/pack-objects.c:4453–4481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4451}
4452
4453static int option_parse_missing_action(const struct option *opt UNUSED,
4454 const char *arg, int unset)
4455{
4456 assert(arg);
4457 assert(!unset);
4458
4459 if (!strcmp(arg, "error")) {
4460 arg_missing_action = MA_ERROR;
4461 fn_show_object = show_object;
4462 return 0;
4463 }
4464
4465 if (!strcmp(arg, "allow-any")) {
4466 arg_missing_action = MA_ALLOW_ANY;
4467 fetch_if_missing = 0;
4468 fn_show_object = show_object__ma_allow_any;
4469 return 0;
4470 }
4471
4472 if (!strcmp(arg, "allow-promisor")) {
4473 arg_missing_action = MA_ALLOW_PROMISOR;
4474 fetch_if_missing = 0;
4475 fn_show_object = show_object__ma_allow_promisor;
4476 return 0;
4477 }
4478
4479 die(_("invalid value for '%s': '%s'"), "--missing", arg);
4480 return 0;
4481}
4482
4483static void show_edge(struct commit *commit)
4484{

Callers 1

cmd_pack_objectsFunction · 0.85

Calls 1

dieFunction · 0.50

Tested by

no test coverage detected