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

[PATCH v3 2/2] ssh signing: make sign/amend test more resilient

From
Fabian Stelzer <fs@gigacodes.de>
Date
Nov 19, 2021, 15:07 UTC
Message-ID
<20211119150707.3924636-3-fs@gigacodes.de>
In-Reply-To
<20211119150707.3924636-1-fs@gigacodes.de>

The test `amending already signed commit` is using git checkout to select a specific commit to amend. In case an earlier test fails and leaves behind a dirty index/worktree this test would fail as well. Using `checkout -f` will avoid interference by most other tests.

Signed-off-by: Fabian Stelzer <fs@gigacodes.de>
---
 t/t7510-signed-commit.sh     | 2 +-
 t/t7528-signed-commit-ssh.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh
index d65a0171f2..9882b69ae2 100755
--- a/t/t7510-signed-commit.sh
+++ b/t/t7510-signed-commit.sh
@@ -228,7 +228,7 @@ test_expect_success GPG 'detect fudged signature with NUL' '
 '
 
 test_expect_success GPG 'amending already signed commit' '
-	git checkout fourth-signed^0 &&
+	git checkout -f fourth-signed^0 &&
 	git commit --amend -S --no-edit &&
 	git verify-commit HEAD &&
 	git show -s --show-signature HEAD >actual &&
diff --git a/t/t7528-signed-commit-ssh.sh b/t/t7528-signed-commit-ssh.sh
index 455eafa15c..0ec5a6d764 100755
--- a/t/t7528-signed-commit-ssh.sh
+++ b/t/t7528-signed-commit-ssh.sh
@@ -239,7 +239,7 @@ test_expect_success GPGSSH 'amending already signed commit' '
 	test_config gpg.format ssh &&
 	test_config user.signingkey "${GPGSSH_KEY_PRIMARY}" &&
 	test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" &&
-	git checkout fourth-signed^0 &&
+	git checkout -f fourth-signed^0 &&
 	git commit --amend -S --no-edit &&
 	git verify-commit HEAD &&
 	git show -s --show-signature HEAD >actual &&
-- 
2.31.1
Previous: Fabian Stelzer
Message 12 of 12 in “ssh signing: support non ssh-* keytypes”
  1. ssh signing: support non ssh-* keytypesFabian Stelzer, Nov 17, 2021
  2. Taylor BlauNov 17, 2021
  3. Junio C HamanoNov 18, 2021
  4. Junio C HamanoNov 18, 2021
  5. Fabian StelzerNov 18, 2021
  6. 1/2 ssh signing: support non ssh-* keytypesFabian Stelzer, Nov 18, 2021
  7. 2/2 ssh signing: make sign/amend test more resilientFabian Stelzer, Nov 18, 2021
  8. Eric SunshineNov 18, 2021
  9. Fabian StelzerNov 19, 2021
  10. 0/2 ssh signing: support non ssh-* keytypesFabian Stelzer, Nov 19, 2021
  11. 1/2 ssh signing: support non ssh-* keytypesFabian Stelzer, Nov 19, 2021
  12. 2/2 ssh signing: make sign/amend test more resilientFabian Stelzer, Nov 19, 2021

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.