From ae03c97ac0e36a33183562464f9506c8b3a73060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C4=8Cavoj?= Date: Sun, 18 Oct 2020 01:15:55 +0200 Subject: sequencer: fix gpg option passed to merge subcommand MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When performing a rebase with --rebase-merges using either a custom strategy specified with -s or an octopus merge, and at the same time having gpgsign enabled (either rebase -S or config commit.gpgsign), the operation would fail on making the merge commit. Instead of "-S%s" with the key id substituted, only the bare key id would get passed to the underlying merge command, which tried to interpret it as a ref. Fix the issue and add test cases as suggested by Johannes Schindelin and Junio C Hamano. Signed-off-by: Samuel Čavoj Signed-off-by: Junio C Hamano --- sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sequencer.c') diff --git a/sequencer.c b/sequencer.c index 00acb12496..88ccff4838 100644 --- a/sequencer.c +++ b/sequencer.c @@ -3677,7 +3677,7 @@ static int do_merge(struct repository *r, strvec_push(&cmd.args, "-F"); strvec_push(&cmd.args, git_path_merge_msg(r)); if (opts->gpg_sign) - strvec_push(&cmd.args, opts->gpg_sign); + strvec_pushf(&cmd.args, "-S%s", opts->gpg_sign); /* Add the tips to be merged */ for (j = to_merge; j; j = j->next) -- cgit v1.2.3