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

Function git_default_branch_config

environment.c:578–614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

576}
577
578static int git_default_branch_config(const char *var, const char *value)
579{
580 struct repo_config_values *cfg = repo_config_values(the_repository);
581
582 if (!strcmp(var, "branch.autosetupmerge")) {
583 if (value && !strcmp(value, "always")) {
584 cfg->branch_track = BRANCH_TRACK_ALWAYS;
585 return 0;
586 } else if (value && !strcmp(value, "inherit")) {
587 cfg->branch_track = BRANCH_TRACK_INHERIT;
588 return 0;
589 } else if (value && !strcmp(value, "simple")) {
590 cfg->branch_track = BRANCH_TRACK_SIMPLE;
591 return 0;
592 }
593 cfg->branch_track = git_config_bool(var, value);
594 return 0;
595 }
596 if (!strcmp(var, "branch.autosetuprebase")) {
597 if (!value)
598 return config_error_nonbool(var);
599 else if (!strcmp(value, "never"))
600 autorebase = AUTOREBASE_NEVER;
601 else if (!strcmp(value, "local"))
602 autorebase = AUTOREBASE_LOCAL;
603 else if (!strcmp(value, "remote"))
604 autorebase = AUTOREBASE_REMOTE;
605 else if (!strcmp(value, "always"))
606 autorebase = AUTOREBASE_ALWAYS;
607 else
608 return error(_("malformed value for %s"), var);
609 return 0;
610 }
611
612 /* Add other config variables here and to Documentation/config.adoc. */
613 return 0;
614}
615
616static int git_default_push_config(const char *var, const char *value)
617{

Callers 1

git_default_configFunction · 0.85

Calls 4

git_config_boolFunction · 0.85
config_error_nonboolFunction · 0.85
errorFunction · 0.85
repo_config_valuesClass · 0.70

Tested by

no test coverage detected