cherry-pick, revert: add the --gpg-sign option
Signed-off-by: Nicolas Vigier <boklm@mars-attacks.org> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
bd3e186d81
commit
3253553e12
11
sequencer.c
11
sequencer.c
@ -392,11 +392,18 @@ static int run_git_commit(const char *defmsg, struct replay_opts *opts,
|
||||
{
|
||||
struct argv_array array;
|
||||
int rc;
|
||||
char *gpg_sign;
|
||||
|
||||
argv_array_init(&array);
|
||||
argv_array_push(&array, "commit");
|
||||
argv_array_push(&array, "-n");
|
||||
|
||||
if (opts->gpg_sign) {
|
||||
gpg_sign = xmalloc(3 + strlen(opts->gpg_sign));
|
||||
sprintf(gpg_sign, "-S%s", opts->gpg_sign);
|
||||
argv_array_push(&array, gpg_sign);
|
||||
free(gpg_sign);
|
||||
}
|
||||
if (opts->signoff)
|
||||
argv_array_push(&array, "-s");
|
||||
if (!opts->edit) {
|
||||
@ -808,6 +815,8 @@ static int populate_opts_cb(const char *key, const char *value, void *data)
|
||||
opts->mainline = git_config_int(key, value);
|
||||
else if (!strcmp(key, "options.strategy"))
|
||||
git_config_string(&opts->strategy, key, value);
|
||||
else if (!strcmp(key, "options.gpg-sign"))
|
||||
git_config_string(&opts->gpg_sign, key, value);
|
||||
else if (!strcmp(key, "options.strategy-option")) {
|
||||
ALLOC_GROW(opts->xopts, opts->xopts_nr + 1, opts->xopts_alloc);
|
||||
opts->xopts[opts->xopts_nr++] = xstrdup(value);
|
||||
@ -981,6 +990,8 @@ static void save_opts(struct replay_opts *opts)
|
||||
}
|
||||
if (opts->strategy)
|
||||
git_config_set_in_file(opts_file, "options.strategy", opts->strategy);
|
||||
if (opts->gpg_sign)
|
||||
git_config_set_in_file(opts_file, "options.gpg-sign", opts->gpg_sign);
|
||||
if (opts->xopts) {
|
||||
int i;
|
||||
for (i = 0; i < opts->xopts_nr; i++)
|
||||
|
Reference in New Issue
Block a user