diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-07-28 12:02:34 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-28 12:02:34 -0700 |
| commit | d345ceda32412d8575234ad8b959d9f598b00a6e (patch) | |
| tree | 3fab6580d77ba77fd75de4d360d36d2db06be60d /config.c | |
| parent | 0f6e5037d40db4768e8b61aea22c68c9711ce544 (diff) | |
| parent | 92b7c7c9f5fde4972a653ddb90eca52c592de07e (diff) | |
| download | git-d345ceda32412d8575234ad8b959d9f598b00a6e.tar.gz | |
Merge branch 'ac/auto-comment-char-fix'
"git commit" that concludes a conflicted merge failed to notice and remove
existing comment added automatically (like "# Conflicts:") when the
core.commentstring is set to 'auto'.
* ac/auto-comment-char-fix:
config: set comment_line_str to "#" when core.commentChar=auto
commit: avoid scanning trailing comments when 'core.commentChar' is "auto"
Diffstat (limited to 'config.c')
| -rw-r--r-- | config.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1534,9 +1534,11 @@ static int git_default_core_config(const char *var, const char *value, !strcmp(var, "core.commentstring")) { if (!value) return config_error_nonbool(var); - else if (!strcasecmp(value, "auto")) + else if (!strcasecmp(value, "auto")) { auto_comment_line_char = 1; - else if (value[0]) { + FREE_AND_NULL(comment_line_str_to_free); + comment_line_str = "#"; + } else if (value[0]) { if (strchr(value, '\n')) return error(_("%s cannot contain newline"), var); comment_line_str = value; |
