summaryrefslogtreecommitdiff
path: root/builtin/rebase.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-04-22 13:42:52 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-04-22 13:42:53 -0700
commitfc3f6fd7bef30895b3f80c1f8a708f5eeb69695b (patch)
tree2f36295ebc5dfd63ee7efb677ac88ad702215b82 /builtin/rebase.c
parentMerge branch 'js/t0007-typofix' (diff)
parentDocumentation: document merge option --no-gpg-sign (diff)
downloadtgif-fc3f6fd7bef30895b3f80c1f8a708f5eeb69695b.tar.xz
Merge branch 'dd/no-gpg-sign'
"git rebase" learned the "--no-gpg-sign" option to countermand commit.gpgSign the user may have. * dd/no-gpg-sign: Documentation: document merge option --no-gpg-sign Documentation: merge commit-tree --[no-]gpg-sign Documentation: reword commit --no-gpg-sign Documentation: document am --no-gpg-sign cherry-pick/revert: honour --no-gpg-sign in all case rebase.c: honour --no-gpg-sign
Diffstat (limited to 'builtin/rebase.c')
-rw-r--r--builtin/rebase.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 27a07d4e78..7e2ad66e9e 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -1593,6 +1593,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
options.allow_empty_message = 1;
git_config(rebase_config, &options);
+ /* options.gpg_sign_opt will be either "-S" or NULL */
+ gpg_sign = options.gpg_sign_opt ? "" : NULL;
+ FREE_AND_NULL(options.gpg_sign_opt);
if (options.use_legacy_rebase ||
!git_env_bool("GIT_TEST_REBASE_USE_BUILTIN", -1))
@@ -1823,10 +1826,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
if (options.empty != EMPTY_UNSPECIFIED)
imply_merge(&options, "--empty");
- if (gpg_sign) {
- free(options.gpg_sign_opt);
+ if (gpg_sign)
options.gpg_sign_opt = xstrfmt("-S%s", gpg_sign);
- }
if (exec.nr) {
int i;