All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabian Stelzer <fs@gigacodes.de>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Taylor Blau <me@ttaylorr.com>,
	Eric Sunshine <sunshine@sunshineco.com>,
	Fabian Stelzer <fs@gigacodes.de>
Subject: [PATCH v3 2/2] ssh signing: make sign/amend test more resilient
Date: Fri, 19 Nov 2021 16:07:07 +0100	[thread overview]
Message-ID: <20211119150707.3924636-3-fs@gigacodes.de> (raw)
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


      parent reply	other threads:[~2021-11-19 15:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17 16:27 [PATCH] ssh signing: support non ssh-* keytypes Fabian Stelzer
2021-11-17 17:51 ` Taylor Blau
2021-11-18  3:09 ` Junio C Hamano
2021-11-18  6:39   ` Junio C Hamano
2021-11-18 15:16     ` Fabian Stelzer
2021-11-18 17:14 ` [PATCH v2 1/2] " Fabian Stelzer
2021-11-18 17:14   ` [PATCH v2 2/2] ssh signing: make sign/amend test more resilient Fabian Stelzer
2021-11-18 22:14   ` [PATCH v2 1/2] ssh signing: support non ssh-* keytypes Eric Sunshine
2021-11-19  9:05     ` Fabian Stelzer
2021-11-19 15:07 ` [PATCH v3 0/2] " Fabian Stelzer
2021-11-19 15:07   ` [PATCH v3 1/2] " Fabian Stelzer
2021-11-19 15:07   ` Fabian Stelzer [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

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

  git send-email \
    --in-reply-to=20211119150707.3924636-3-fs@gigacodes.de \
    --to=fs@gigacodes.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.com \
    --cc=sunshine@sunshineco.com \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.