Skip to content

Commit 43ad4f2

Browse files
sammkogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 19dad04 commit 43ad4f2

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

t/t3435-rebase-gpg-sign.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,32 @@ test_expect_success "rebase -r, merge strategy, commit.gpgsign=true --no-gpg-sig
9696
test_must_fail git verify-commit HEAD
9797
'
9898

99+
test_expect_success 'rebase -r --gpg-sign will sign commit' '
100+
git reset --hard merged &&
101+
test_unconfig commit.gpgsign &&
102+
git rebase -fr --gpg-sign --root &&
103+
git verify-commit HEAD
104+
'
105+
106+
test_expect_success 'rebase -r with commit.gpgsign=true will sign commit' '
107+
git reset --hard merged &&
108+
git config commit.gpgsign true &&
109+
git rebase -fr --root &&
110+
git verify-commit HEAD
111+
'
112+
113+
test_expect_success 'rebase -r --gpg-sign with commit.gpgsign=false will sign commit' '
114+
git reset --hard merged &&
115+
git config commit.gpgsign false &&
116+
git rebase -fr --gpg-sign --root &&
117+
git verify-commit HEAD
118+
'
119+
120+
test_expect_success "rebase -r --no-gpg-sign with commit.gpgsign=true won't sign commit" '
121+
git reset --hard merged &&
122+
git config commit.gpgsign true &&
123+
git rebase -fr --no-gpg-sign --root &&
124+
test_must_fail git verify-commit HEAD
125+
'
126+
99127
test_done

0 commit comments

Comments
 (0)