MCPcopy Index your code
hub / github.com/git/git / rebase_parse_value

Function rebase_parse_value

rebase.c:17–37  ·  view source on GitHub ↗

* Parses textual value for pull.rebase, branch. .rebase, etc. * Unrecognised value yields REBASE_INVALID, which traditionally is * treated the same way as REBASE_FALSE. * * The callers that care if (any) rebase is requested should say * if (REBASE_TRUE <= rebase_parse_value(string)) * * The callers that want to differentiate an unrecognised value and * false can do so by treating _I

Source from the content-addressed store, hash-verified

15 * false can do so by treating _INVALID and _FALSE differently.
16 */
17enum rebase_type rebase_parse_value(const char *value)
18{
19 int v = git_parse_maybe_bool(value);
20
21 if (!v)
22 return REBASE_FALSE;
23 else if (v > 0)
24 return REBASE_TRUE;
25 else if (!strcmp(value, "merges") || !strcmp(value, "m"))
26 return REBASE_MERGES;
27 else if (!strcmp(value, "interactive") || !strcmp(value, "i"))
28 return REBASE_INTERACTIVE;
29 else if (!strcmp(value, "preserve") || !strcmp(value, "p"))
30 error(_("%s: 'preserve' superseded by 'merges'"), value);
31 /*
32 * Please update _git_config() in git-completion.bash when you
33 * add new rebase modes.
34 */
35
36 return REBASE_INVALID;
37}

Callers 2

config_read_branchesFunction · 0.85
parse_config_rebaseFunction · 0.85

Calls 2

git_parse_maybe_boolFunction · 0.85
errorFunction · 0.85

Tested by

no test coverage detected