diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2014-02-17 19:15:32 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-02-25 09:35:20 -0800 |
commit | 75df1f434f8cfdac1c8eeacae259ab375c01385b (patch) | |
tree | 073ed4370f17e679c2fd8047c1c7fd832266db7b /t/t7502-commit.sh | |
parent | fcef9312a4ad3d94bfa2d02c41e46eb6adcde9b1 (diff) | |
download | git-75df1f434f8cfdac1c8eeacae259ab375c01385b.tar.gz |
commit: add --cleanup=scissorsnd/commit-editor-cleanup
Since 1a72cfd (commit -v: strip diffs and submodule shortlogs from the
commit message - 2013-12-05) we have a less fragile way to cut out
"git status" at the end of a commit message but it's only enabled for
stripping submodule shortlogs.
Add new cleanup option that reuses the same mechanism for the entire
"git status" without accidentally removing lines starting with '#'.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7502-commit.sh')
-rwxr-xr-x | t/t7502-commit.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh index 6313da2cdd..9a3f3a1b41 100755 --- a/t/t7502-commit.sh +++ b/t/t7502-commit.sh @@ -223,6 +223,22 @@ test_expect_success 'cleanup commit messages (whitespace option,-F)' ' ' +test_expect_success 'cleanup commit messages (scissors option,-F,-e)' ' + + echo >>negative && + cat >text <<EOF && + +# to be kept +# ------------------------ >8 ------------------------ +to be removed +EOF + echo "# to be kept" >expect && + git commit --cleanup=scissors -e -F text -a && + git cat-file -p HEAD |sed -e "1,/^\$/d">actual && + test_cmp expect actual + +' + test_expect_success 'cleanup commit messages (strip option,-F)' ' echo >>negative && |