diff options
author | Phillip Wood <phillip.wood@dunelm.org.uk> | 2019-03-29 11:08:42 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-04-18 13:48:42 +0900 |
commit | d74f3e58114d1a8544592fcd5dcdfe0fc4993d27 (patch) | |
tree | 3bbcec2e4b738475e520f259695867653bfed0b0 /t/t3511-cherry-pick-x.sh | |
parent | The fifth batch (diff) | |
download | tgif-d74f3e58114d1a8544592fcd5dcdfe0fc4993d27.tar.xz |
sequencer: fix cleanup with --signoff and -x
Before commit 356ee4659b ("sequencer: try to commit without forking 'git
commit'", 2017-11-24) when --signoff or -x were given on the command
line the commit message was cleaned up with --cleanup=space or
commit.cleanup if it was set. Unfortunately this behavior was lost when
I implemented committing without forking. Fix this and add some tests to
catch future regressions.
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3511-cherry-pick-x.sh')
-rwxr-xr-x | t/t3511-cherry-pick-x.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t3511-cherry-pick-x.sh b/t/t3511-cherry-pick-x.sh index 9888bf34b9..84a587daf3 100755 --- a/t/t3511-cherry-pick-x.sh +++ b/t/t3511-cherry-pick-x.sh @@ -298,4 +298,24 @@ test_expect_success 'cherry-pick preserves commit message' ' test_cmp expect actual ' +test_expect_success 'cherry-pick -x cleans commit message' ' + pristine_detach initial && + git cherry-pick -x mesg-unclean && + git log -1 --pretty=format:%B >actual && + printf "%s\n(cherry picked from commit %s)\n" \ + "$mesg_unclean" $(git rev-parse mesg-unclean) | + git stripspace >expect && + test_cmp expect actual +' + +test_expect_success 'cherry-pick -x respects commit.cleanup' ' + pristine_detach initial && + git -c commit.cleanup=strip cherry-pick -x mesg-unclean && + git log -1 --pretty=format:%B >actual && + printf "%s\n(cherry picked from commit %s)\n" \ + "$mesg_unclean" $(git rev-parse mesg-unclean) | + git stripspace -s >expect && + test_cmp expect actual +' + test_done |