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

Function parse_push_recurse

submodule-config.c:498–526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

496}
497
498static int parse_push_recurse(const char *opt, const char *arg,
499 int die_on_error)
500{
501 switch (git_parse_maybe_bool(arg)) {
502 case 1:
503 /* There's no simple "on" value when pushing */
504 if (die_on_error)
505 die("bad %s argument: %s", opt, arg);
506 else
507 return RECURSE_SUBMODULES_ERROR;
508 case 0:
509 return RECURSE_SUBMODULES_OFF;
510 default:
511 if (!strcmp(arg, "on-demand"))
512 return RECURSE_SUBMODULES_ON_DEMAND;
513 else if (!strcmp(arg, "check"))
514 return RECURSE_SUBMODULES_CHECK;
515 else if (!strcmp(arg, "only"))
516 return RECURSE_SUBMODULES_ONLY;
517 /*
518 * Please update $__git_push_recurse_submodules in
519 * git-completion.bash when you add new modes.
520 */
521 else if (die_on_error)
522 die("bad %s argument: %s", opt, arg);
523 else
524 return RECURSE_SUBMODULES_ERROR;
525 }
526}
527
528int parse_push_recurse_submodules_arg(const char *opt, const char *arg)
529{

Callers 1

Calls 2

git_parse_maybe_boolFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected