Merge branch 'ah/no-verify-signature-with-pull-rebase'
authorJunio C Hamano <gitster@pobox.com>
Mon, 20 Jun 2016 18:01:00 +0000 (11:01 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Jun 2016 18:01:00 +0000 (11:01 -0700)
"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

builtin/pull.c
t/t5520-pull.sh
index 1d7333c8a11f7aedf244c99f5ac67bea7fccaab4..897a7f4e4e040089b4021a9a0e217fbb63e7c6ec 100644 (file)
@@ -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));
index 739c089d500f76cbf726f0083062420a51874fc1..3159956fde89639354fe5ed4d3cdf083a2cbbb0f 100755 (executable)
@@ -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.