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"));
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)
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);
}