git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v4 3/3] t3435: add tests for rebase -r GPG signing

From
Samuel Čavoj <samuel@cavoj.net>
Date
Oct 17, 2020, 23:15 UTC
Message-ID
<20201017231557.1001728-3-samuel@cavoj.net>
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
Previous: Samuel ČavojNext: Samuel Čavoj
Message 2 of 3 in “sequencer: fix gpg option passed to merge subcommand”
  1. 1/3 sequencer: fix gpg option passed to merge subcommandSamuel Čavoj, Oct 17, 2020
  2. 3/3 t3435: add tests for rebase -r GPG signingSamuel Čavoj, Oct 17, 2020
  3. 2/3 sequencer: pass explicit --no-gpg-sign to mergeSamuel Čavoj, Oct 17, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.