summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-06-06 18:36:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-06 18:36:10 (GMT)
commit1e2600dd6a2acf8d2e9c0923184ca2335b861138 (patch)
tree3cf920ef1d92e62eae2b5f7cac17f2045c63fd6c /t
parent075652953772dbabd01d471a4c73200b0ab5d8a6 (diff)
parent84c9dc2c5a2d34351a06554af32501d4f99990e9 (diff)
downloadgit-1e2600dd6a2acf8d2e9c0923184ca2335b861138.zip
git-1e2600dd6a2acf8d2e9c0923184ca2335b861138.tar.gz
git-1e2600dd6a2acf8d2e9c0923184ca2335b861138.tar.bz2
Merge branch 'nd/status-auto-comment-char'
* nd/status-auto-comment-char: commit: allow core.commentChar=auto for character auto selection config: be strict on core.commentChar
Diffstat (limited to 't')
-rwxr-xr-xt/t7502-commit.sh26
-rwxr-xr-xt/t7508-status.sh3
2 files changed, 27 insertions, 2 deletions
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 6465cd5..051489e 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -570,4 +570,30 @@ test_expect_success 'commit --status with custom comment character' '
test_i18ngrep "^; Changes to be committed:" .git/COMMIT_EDITMSG
'
+test_expect_success 'switch core.commentchar' '
+ test_commit "#foo" foo &&
+ GIT_EDITOR=.git/FAKE_EDITOR git -c core.commentChar=auto commit --amend &&
+ test_i18ngrep "^; Changes to be committed:" .git/COMMIT_EDITMSG
+'
+
+test_expect_success 'switch core.commentchar but out of options' '
+ cat >text <<\EOF &&
+# 1
+; 2
+@ 3
+! 4
+$ 5
+% 6
+^ 7
+& 8
+| 9
+: 10
+EOF
+ git commit --amend -F text &&
+ (
+ test_set_editor .git/FAKE_EDITOR &&
+ test_must_fail git -c core.commentChar=auto commit --amend
+ )
+'
+
test_done
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index c987b5e..148ab9e 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -1350,8 +1350,7 @@ test_expect_success "status (core.commentchar with submodule summary)" '
test_expect_success "status (core.commentchar with two chars with submodule summary)" '
test_config core.commentchar ";;" &&
- git -c status.displayCommentPrefix=true status >output &&
- test_i18ncmp expect output
+ test_must_fail git -c status.displayCommentPrefix=true status
'
test_expect_success "--ignore-submodules=all suppresses submodule summary" '