Merge branch 'xf/user-manual-markup'
[gitweb.git] / t / t7502-commit.sh
index 21d71b5ef793f5b4aba698611a746434838ff710..b39e313ac2a7393899e2fbaa5bc860c4d95c68ee 100755 (executable)
@@ -366,6 +366,13 @@ test_expect_success 'message shows author when it is not equal to committer' '
          .git/COMMIT_EDITMSG
 '
 
+test_expect_success 'message shows date when it is explicitly set' '
+       git commit --allow-empty -e -m foo --date="2010-01-02T03:04:05" &&
+       test_i18ngrep \
+         "^# Date: *Sat Jan 2 03:04:05 2010 +0000" \
+         .git/COMMIT_EDITMSG
+'
+
 test_expect_success AUTOIDENT 'message shows committer when it is automatic' '
 
        echo >>negative &&
@@ -385,7 +392,7 @@ exit 0
 EOF
 
 test_expect_success !AUTOIDENT 'do not fire editor when committer is bogus' '
-       >.git/result
+       >.git/result &&
        >expect &&
 
        echo >>negative &&
@@ -585,4 +592,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