3 test_description
='git rebase --signoff
5 This test runs git rebase --signoff and make sure that it works.
10 # A simple file to commit
15 # Expected commit message after rebase --signoff
16 cat >expected-signed
<<EOF
19 Signed-off-by: $(git var GIT_COMMITTER_IDENT | sed -e "s/>.*/>/")
22 # Expected commit message after rebase without --signoff (or with --no-signoff)
23 cat >expected-unsigned
<<EOF
28 # We configure an alias to do the rebase --signoff so that
29 # on the next subtest we can show that --no-signoff overrides the alias
30 test_expect_success
'rebase --signoff adds a sign-off line' '
31 git commit --allow-empty -m "Initial empty commit" &&
32 git add file && git commit -m first &&
33 git config alias.rbs "rebase --signoff" &&
35 git cat-file commit HEAD | sed -e "1,/^\$/d" > actual &&
36 test_cmp expected-signed actual
39 test_expect_success
'rebase --no-signoff does not add a sign-off line' '
40 git commit --amend -m "first" &&
41 git rbs --no-signoff HEAD^ &&
42 git cat-file commit HEAD | sed -e "1,/^\$/d" > actual &&
43 test_cmp expected-unsigned actual