summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-06-20 11:01:00 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-06-20 11:01:00 -0700
commit73bc4b4928e0111aa97c9963535223abb6fb2545 (patch)
treef6178690acea2486b67b59c2c625a1a3ff0f0c33
parentMerge branch 'ew/fast-import-unpack-limit' (diff)
parentpull: warn on --verify-signatures with --rebase (diff)
downloadtgif-73bc4b4928e0111aa97c9963535223abb6fb2545.tar.xz
Merge branch 'ah/no-verify-signature-with-pull-rebase'
"git pull --rebase --verify-signature" learned to warn the user that "--verify-signature" is a no-op when rebasing. * ah/no-verify-signature-with-pull-rebase: pull: warn on --verify-signatures with --rebase
-rw-r--r--builtin/pull.c3
-rwxr-xr-xt/t5520-pull.sh16
2 files changed, 19 insertions, 0 deletions
diff --git a/builtin/pull.c b/builtin/pull.c
index 1d7333c8a1..897a7f4e4e 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -815,6 +815,9 @@ static int run_rebase(const unsigned char *curr_head,
argv_array_push(&args, "--no-autostash");
else if (opt_autostash == 1)
argv_array_push(&args, "--autostash");
+ if (opt_verify_signatures &&
+ !strcmp(opt_verify_signatures, "--verify-signatures"))
+ warning(_("ignoring --verify-signatures for rebase"));
argv_array_push(&args, "--onto");
argv_array_push(&args, sha1_to_hex(merge_head));
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index 739c089d50..3159956fde 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -341,6 +341,22 @@ test_expect_success 'branch.to-rebase.rebase should override pull.rebase' '
test new = "$(git show HEAD:file2)"
'
+test_expect_success "pull --rebase warns on --verify-signatures" '
+ git reset --hard before-rebase &&
+ git pull --rebase --verify-signatures . copy 2>err &&
+ test "$(git rev-parse HEAD^)" = "$(git rev-parse copy)" &&
+ test new = "$(git show HEAD:file2)" &&
+ test_i18ngrep "ignoring --verify-signatures for rebase" err
+'
+
+test_expect_success "pull --rebase does not warn on --no-verify-signatures" '
+ git reset --hard before-rebase &&
+ git pull --rebase --no-verify-signatures . copy 2>err &&
+ test "$(git rev-parse HEAD^)" = "$(git rev-parse copy)" &&
+ test new = "$(git show HEAD:file2)" &&
+ test_i18ngrep ! "verify-signatures" err
+'
+
# add a feature branch, keep-merge, that is merged into master, so the
# test can try preserving the merge commit (or not) with various
# --rebase flags/pull.rebase settings.