summaryrefslogtreecommitdiff
path: root/builtin/revert.c
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2017-11-24 11:07:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-11-24 13:44:18 (GMT)
commitb36c5908135889bd9c48a8d44d4e07f59bf799ef (patch)
tree5319aebe315eb106d7b4e47164740c50295ce97d /builtin/revert.c
parentb34eeea352f15f93e98982a0e7970b0026053fb2 (diff)
downloadgit-b36c5908135889bd9c48a8d44d4e07f59bf799ef.zip
git-b36c5908135889bd9c48a8d44d4e07f59bf799ef.tar.gz
git-b36c5908135889bd9c48a8d44d4e07f59bf799ef.tar.bz2
sequencer: load commit related config
Load default values for message cleanup and gpg signing of commits in preparation for committing without forking 'git commit'. Note that we interpret commit.cleanup=scissors to mean COMMIT_MSG_CLEANUP_SPACE to be consistent with 'git commit' Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/revert.c')
-rw-r--r--builtin/revert.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/builtin/revert.c b/builtin/revert.c
index b9d927e..1938825 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -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"));