This commit adds test for amending the latest commit to add Signed-off-by trailer at the end of commit message. Signed-off-by: Ghanshyam Thakkar <shyamthakkar001@xxxxxxxxx> --- t/t7501-commit-basic-functionality.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/t/t7501-commit-basic-functionality.sh b/t/t7501-commit-basic-functionality.sh index 71dc52ce3a..35c69c3ddd 100755 --- a/t/t7501-commit-basic-functionality.sh +++ b/t/t7501-commit-basic-functionality.sh @@ -464,6 +464,24 @@ test_expect_success 'amend commit to fix author' ' ' +test_expect_success 'amend commit to add signoff' ' + + test_when_finished "rm -rf testdir" && + git init testdir && + echo content >testdir/file && + git -C testdir add file && + git -C testdir commit -m "file" && + git -C testdir commit --amend --signoff && + git -C testdir log -1 --pretty=format:%B >actual && + ( + echo file && + echo && + git -C testdir var GIT_COMMITTER_IDENT >ident && + sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /" ident + ) >expected && + test_cmp expected actual +' + test_expect_success 'amend commit to fix date' ' test_tick && -- 2.43.0