diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-06-06 11:36:10 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-06-06 11:36:10 -0700 |
commit | 1e2600dd6a2acf8d2e9c0923184ca2335b861138 (patch) | |
tree | 3cf920ef1d92e62eae2b5f7cac17f2045c63fd6c /config.c | |
parent | 075652953772dbabd01d471a4c73200b0ab5d8a6 (diff) | |
parent | 84c9dc2c5a2d34351a06554af32501d4f99990e9 (diff) | |
download | git-1e2600dd6a2acf8d2e9c0923184ca2335b861138.tar.gz |
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 'config.c')
-rw-r--r-- | config.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -826,9 +826,16 @@ static int git_default_core_config(const char *var, const char *value) if (!strcmp(var, "core.commentchar")) { const char *comment; int ret = git_config_string(&comment, var, value); - if (!ret) + if (ret) + return ret; + else if (!strcasecmp(comment, "auto")) + auto_comment_line_char = 1; + else if (comment[0] && !comment[1]) { comment_line_char = comment[0]; - return ret; + auto_comment_line_char = 0; + } else + return error("core.commentChar should only be one character"); + return 0; } if (!strcmp(var, "core.askpass")) |