]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t3435: add tests for rebase -r GPG signing
authorSamuel Čavoj <samuel@cavoj.net>
Sat, 17 Oct 2020 23:15:57 +0000 (01:15 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 18 Oct 2020 20:08:33 +0000 (13:08 -0700)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3435-rebase-gpg-sign.sh

index 2fba21f77a0c270ca0bf0a9b06b3741725f1e0b9..54120b09d6e9b6e29784393458671d715b06efc4 100755 (executable)
@@ -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