Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>2020-04-03 13:28:02 +0300
committerJunio C Hamano <gitster@pobox.com>2020-04-03 21:37:22 +0300
commitc241371c0445cee7116e36bbacb5b35069a81e64 (patch)
tree2b1cbabe43a9d903cb18512321c6ae9e19aad6f2 /builtin/rebase.c
parent274b9cc25322d9ee79aa8e6d4e86f0ffe5ced925 (diff)
rebase.c: honour --no-gpg-sign
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 bff53d5d167..24b88936742 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -1592,6 +1592,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))
@@ -1822,10 +1825,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;