summaryrefslogtreecommitdiff
path: root/t/t3435-rebase-gpg-sign.sh
diff options
context:
space:
mode:
authorSamuel Čavoj <samuel@cavoj.net>2020-10-17 23:15:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-10-18 20:08:33 (GMT)
commit43ad4f2eca811afe7eb2eb089afc9f501fd8a2c6 (patch)
treedd7bb08b1d4833416298c12cd1d8e0d4af510571 /t/t3435-rebase-gpg-sign.sh
parent19dad040ed19761e8d6d63b4efd03ad846b81d06 (diff)
downloadgit-43ad4f2eca811afe7eb2eb089afc9f501fd8a2c6.zip
git-43ad4f2eca811afe7eb2eb089afc9f501fd8a2c6.tar.gz
git-43ad4f2eca811afe7eb2eb089afc9f501fd8a2c6.tar.bz2
t3435: add tests for rebase -r GPG signing
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>
Diffstat (limited to 't/t3435-rebase-gpg-sign.sh')
-rwxr-xr-xt/t3435-rebase-gpg-sign.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t3435-rebase-gpg-sign.sh b/t/t3435-rebase-gpg-sign.sh
index 2fba21f..54120b0 100755
--- a/t/t3435-rebase-gpg-sign.sh
+++ b/t/t3435-rebase-gpg-sign.sh
@@ -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