summaryrefslogtreecommitdiff
path: root/t/t7502-commit.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-06-24 19:21:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-06-24 19:21:55 (GMT)
commit07528be1018b72e463404624b8752ead7eb0eb8d (patch)
tree5d08b81961e129a3d8c42f3ecd23ceec83b08f1b /t/t7502-commit.sh
parent712b351bd37d4e4676d1165993cad4cc2176b346 (diff)
parentfbfa0973faf47e475854a8919097d5db29acf536 (diff)
downloadgit-07528be1018b72e463404624b8752ead7eb0eb8d.zip
git-07528be1018b72e463404624b8752ead7eb0eb8d.tar.gz
git-07528be1018b72e463404624b8752ead7eb0eb8d.tar.bz2
Merge branch 'sg/commit-cleanup-scissors'
"git commit --cleanup=scissors" was not careful enough to protect against getting fooled by a line that looked like scissors. * sg/commit-cleanup-scissors: commit: cope with scissors lines in commit message
Diffstat (limited to 't/t7502-commit.sh')
-rwxr-xr-xt/t7502-commit.sh24
1 files changed, 23 insertions, 1 deletions
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 2e0d557..b39e313 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -229,14 +229,36 @@ test_expect_success 'cleanup commit messages (scissors option,-F,-e)' '
cat >text <<EOF &&
# to be kept
+
+ # ------------------------ >8 ------------------------
+# to be kept, too
# ------------------------ >8 ------------------------
to be removed
+# ------------------------ >8 ------------------------
+to be removed, too
+EOF
+
+ cat >expect <<EOF &&
+# to be kept
+
+ # ------------------------ >8 ------------------------
+# to be kept, too
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 (scissors option,-F,-e, scissors on first line)' '
+
+ echo >>negative &&
+ cat >text <<EOF &&
+# ------------------------ >8 ------------------------
+to be removed
+EOF
+ git commit --cleanup=scissors -e -F text -a --allow-empty-message &&
+ git cat-file -p HEAD |sed -e "1,/^\$/d">actual &&
+ test_must_be_empty actual
'
test_expect_success 'cleanup commit messages (strip option,-F)' '