sequencer: try to commit without forking 'git commit'
[gitweb.git] / builtin / revert.c
index b9d927eb09c9ed87c84681df1396f4e6d9b13c97..1938825efa6ad20ede5aba57f097863aeb33d1d5 100644 (file)
@@ -31,6 +31,17 @@ static const char * const cherry_pick_usage[] = {
        NULL
 };
 
+static int common_config(const char *k, const char *v, void *cb)
+{
+       int status;
+
+       status = git_sequencer_config(k, v, NULL);
+       if (status)
+               return status;
+
+       return git_default_config(k, v, NULL);
+}
+
 static const char *action_name(const struct replay_opts *opts)
 {
        return opts->action == REPLAY_REVERT ? "revert" : "cherry-pick";
@@ -208,7 +219,7 @@ int cmd_revert(int argc, const char **argv, const char *prefix)
        if (isatty(0))
                opts.edit = 1;
        opts.action = REPLAY_REVERT;
-       git_config(git_default_config, NULL);
+       git_config(common_config, NULL);
        res = run_sequencer(argc, argv, &opts);
        if (res < 0)
                die(_("revert failed"));
@@ -221,7 +232,7 @@ int cmd_cherry_pick(int argc, const char **argv, const char *prefix)
        int res;
 
        opts.action = REPLAY_PICK;
-       git_config(git_default_config, NULL);
+       git_config(common_config, NULL);
        res = run_sequencer(argc, argv, &opts);
        if (res < 0)
                die(_("cherry-pick failed"));