diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-02-25 20:18:32 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-02-25 20:18:32 +0100 |
commit | d0038f4b31d6ab1f0602a4d3c19e35c5004175fa (patch) | |
tree | 2b67cde99b211b34335e838515690896794c6d75 /builtin/pull.c | |
parent | The sixth batch for 2.26 (diff) | |
parent | remote rename/remove: gently handle remote.pushDefault config (diff) | |
download | git-d0038f4b31d6ab1f0602a4d3c19e35c5004175fa.tar.xz git-d0038f4b31d6ab1f0602a4d3c19e35c5004175fa.zip |
Merge branch 'bw/remote-rename-update-config'
"git remote rename X Y" needs to adjust configuration variables
(e.g. branch.<name>.remote) whose value used to be X to Y.
branch.<name>.pushRemote is now also updated.
* bw/remote-rename-update-config:
remote rename/remove: gently handle remote.pushDefault config
config: provide access to the current line number
remote rename/remove: handle branch.<name>.pushRemote config values
remote: clean-up config callback
remote: clean-up by returning early to avoid one indentation
pull --rebase/remote rename: document and honor single-letter abbreviations rebase types
Diffstat (limited to 'builtin/pull.c')
-rw-r--r-- | builtin/pull.c | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/builtin/pull.c b/builtin/pull.c index d4e3e77c8e..3e624d1e00 100644 --- a/builtin/pull.c +++ b/builtin/pull.c @@ -15,6 +15,7 @@ #include "sha1-array.h" #include "remote.h" #include "dir.h" +#include "rebase.h" #include "refs.h" #include "refspec.h" #include "revision.h" @@ -26,15 +27,6 @@ #include "commit-reach.h" #include "sequencer.h" -enum rebase_type { - REBASE_INVALID = -1, - REBASE_FALSE = 0, - REBASE_TRUE, - REBASE_PRESERVE, - REBASE_MERGES, - REBASE_INTERACTIVE -}; - /** * Parses the value of --rebase. If value is a false value, returns * REBASE_FALSE. If value is a true value, returns REBASE_TRUE. If value is @@ -45,22 +37,9 @@ enum rebase_type { static enum rebase_type parse_config_rebase(const char *key, const char *value, int fatal) { - int v = git_parse_maybe_bool(value); - - if (!v) - return REBASE_FALSE; - else if (v > 0) - return REBASE_TRUE; - else if (!strcmp(value, "preserve") || !strcmp(value, "p")) - return REBASE_PRESERVE; - else if (!strcmp(value, "merges") || !strcmp(value, "m")) - return REBASE_MERGES; - else if (!strcmp(value, "interactive") || !strcmp(value, "i")) - return REBASE_INTERACTIVE; - /* - * Please update _git_config() in git-completion.bash when you - * add new rebase modes. - */ + enum rebase_type v = rebase_parse_value(value); + if (v != REBASE_INVALID) + return v; if (fatal) die(_("Invalid value for %s: %s"), key, value); |