git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Samuel Čavoj" <samuel@cavoj.net>
To: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Cc: "Phillip Wood" <phillip.wood123@gmail.com>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"brian m. carlson" <sandals@crustytoothpaste.net>,
	"Samuel Čavoj" <samuel@cavoj.net>
Subject: [PATCH v4 3/3] t3435: add tests for rebase -r GPG signing
Date: Sun, 18 Oct 2020 01:15:57 +0200	[thread overview]
Message-ID: <20201017231557.1001728-3-samuel@cavoj.net> (raw)
In-Reply-To: <20201017231557.1001728-1-samuel@cavoj.net>

Add test cases of various combinations of the commit.gpgsign option and
--gpg-sign, --no-gpg-sign flags with rebase -r with the default merge
strategy. This excercises a different code-path from those with octopus
merges or overridden merge strategy with rebase -s.

Signed-off-by: Samuel Čavoj <samuel@cavoj.net>
---
changed v3 -> v4:
    * new
---
 t/t3435-rebase-gpg-sign.sh | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/t/t3435-rebase-gpg-sign.sh b/t/t3435-rebase-gpg-sign.sh
index 2fba21f77a..54120b09d6 100755
--- a/t/t3435-rebase-gpg-sign.sh
+++ b/t/t3435-rebase-gpg-sign.sh
@@ -96,4 +96,32 @@ test_expect_success "rebase -r, merge strategy, commit.gpgsign=true --no-gpg-sig
 	test_must_fail git verify-commit HEAD
 '
 
+test_expect_success 'rebase -r --gpg-sign will sign commit' '
+	git reset --hard merged &&
+	test_unconfig commit.gpgsign &&
+	git rebase -fr --gpg-sign --root &&
+	git verify-commit HEAD
+'
+
+test_expect_success 'rebase -r with commit.gpgsign=true will sign commit' '
+	git reset --hard merged &&
+	git config commit.gpgsign true &&
+	git rebase -fr --root &&
+	git verify-commit HEAD
+'
+
+test_expect_success 'rebase -r --gpg-sign with commit.gpgsign=false will sign commit' '
+	git reset --hard merged &&
+	git config commit.gpgsign false &&
+	git rebase -fr --gpg-sign --root &&
+	git verify-commit HEAD
+'
+
+test_expect_success "rebase -r --no-gpg-sign with commit.gpgsign=true won't sign commit" '
+	git reset --hard merged &&
+	git config commit.gpgsign true &&
+	git rebase -fr --no-gpg-sign --root &&
+	test_must_fail git verify-commit HEAD
+'
+
 test_done
-- 
2.28.0


      parent reply	other threads:[~2020-10-17 23:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-17 23:15 [PATCH v4 1/3] sequencer: fix gpg option passed to merge subcommand Samuel Čavoj
2020-10-17 23:15 ` [PATCH v4 2/3] sequencer: pass explicit --no-gpg-sign to merge Samuel Čavoj
2020-10-17 23:15 ` Samuel Čavoj [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201017231557.1001728-3-samuel@cavoj.net \
    --to=samuel@cavoj.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=phillip.wood123@gmail.com \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).