]> git.ipfire.org Git - thirdparty/git.git/commitdiff
ssh signing: make sign/amend test more resilient
authorFabian Stelzer <fs@gigacodes.de>
Fri, 19 Nov 2021 15:07:07 +0000 (16:07 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Nov 2021 17:05:27 +0000 (09:05 -0800)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7510-signed-commit.sh
t/t7528-signed-commit-ssh.sh

index d65a0171f29c85b437721d823737189a9d72df81..9882b69ae297000a0f64a05ab6ac0aec9f4ca50c 100755 (executable)
@@ -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 &&
index 455eafa15c0d16127f59a3dc2b3dfe2c9b9e7b46..0ec5a6d7649ebaf6eb5b0df743aecea9c8d9d2c5 100755 (executable)
@@ -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 &&