Skip to content

Commit 3b4b5a7

Browse files
FStelzergitster
authored andcommitted
ssh signing: make sign/amend test more resilient
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 350a251 commit 3b4b5a7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

t/t7510-signed-commit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ test_expect_success GPG 'detect fudged signature with NUL' '
228228
'
229229

230230
test_expect_success GPG 'amending already signed commit' '
231-
git checkout fourth-signed^0 &&
231+
git checkout -f fourth-signed^0 &&
232232
git commit --amend -S --no-edit &&
233233
git verify-commit HEAD &&
234234
git show -s --show-signature HEAD >actual &&

t/t7528-signed-commit-ssh.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ test_expect_success GPGSSH 'amending already signed commit' '
239239
test_config gpg.format ssh &&
240240
test_config user.signingkey "${GPGSSH_KEY_PRIMARY}" &&
241241
test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" &&
242-
git checkout fourth-signed^0 &&
242+
git checkout -f fourth-signed^0 &&
243243
git commit --amend -S --no-edit &&
244244
git verify-commit HEAD &&
245245
git show -s --show-signature HEAD >actual &&

0 commit comments

Comments
 (0)