diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/revert.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/builtin/revert.c b/builtin/revert.c index 50f72debe0..90fe2efe94 100644 --- a/builtin/revert.c +++ b/builtin/revert.c @@ -563,16 +563,12 @@ static void read_and_refresh_cache(struct replay_opts *opts) rollback_lock_file(&index_lock); } -static int revert_or_cherry_pick(int argc, const char **argv, - struct replay_opts *opts) +static int pick_commits(struct replay_opts *opts) { struct rev_info revs; struct commit *commit; - git_config(git_default_config, NULL); setenv(GIT_REFLOG_ACTION, action_name(opts), 0); - parse_args(argc, argv, opts); - if (opts->allow_ff) { if (opts->signoff) die(_("cherry-pick --ff cannot be used with --signoff")); @@ -605,7 +601,9 @@ int cmd_revert(int argc, const char **argv, const char *prefix) if (isatty(0)) opts.edit = 1; opts.action = REVERT; - return revert_or_cherry_pick(argc, argv, &opts); + git_config(git_default_config, NULL); + parse_args(argc, argv, &opts); + return pick_commits(&opts); } int cmd_cherry_pick(int argc, const char **argv, const char *prefix) @@ -614,5 +612,7 @@ int cmd_cherry_pick(int argc, const char **argv, const char *prefix) memset(&opts, 0, sizeof(opts)); opts.action = CHERRY_PICK; - return revert_or_cherry_pick(argc, argv, &opts); + git_config(git_default_config, NULL); + parse_args(argc, argv, &opts); + return pick_commits(&opts); } |