]>
git.ipfire.org Git - thirdparty/git.git/blob - rebase.c
1 #include "git-compat-util.h"
7 * Parses textual value for pull.rebase, branch.<name>.rebase, etc.
8 * Unrecognised value yields REBASE_INVALID, which traditionally is
9 * treated the same way as REBASE_FALSE.
11 * The callers that care if (any) rebase is requested should say
12 * if (REBASE_TRUE <= rebase_parse_value(string))
14 * The callers that want to differenciate an unrecognised value and
15 * false can do so by treating _INVALID and _FALSE differently.
17 enum rebase_type
rebase_parse_value(const char *value
)
19 int v
= git_parse_maybe_bool(value
);
25 else if (!strcmp(value
, "merges") || !strcmp(value
, "m"))
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
);
32 * Please update _git_config() in git-completion.bash when you
33 * add new rebase modes.
36 return REBASE_INVALID
;