]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/commit.c
environment: store comment_line_char as a string
[thirdparty/git.git] / builtin / commit.c
index 6d1fa71676f735b7ef1c3ab7bd56b767348ed992..d8abbe48b17b9b63f47b59013ed61bcfcde4ddd4 100644 (file)
@@ -684,9 +684,10 @@ static void adjust_comment_line_char(const struct strbuf *sb)
        char *candidate;
        const char *p;
 
-       comment_line_char = candidates[0];
-       if (!memchr(sb->buf, comment_line_char, sb->len))
+       if (!memchr(sb->buf, candidates[0], sb->len)) {
+               comment_line_str = xstrfmt("%c", candidates[0]);
                return;
+       }
 
        p = sb->buf;
        candidate = strchr(candidates, *p);
@@ -705,7 +706,7 @@ static void adjust_comment_line_char(const struct strbuf *sb)
        if (!*p)
                die(_("unable to select a comment character that is not used\n"
                      "in the current commit message"));
-       comment_line_char = *p;
+       comment_line_str = xstrfmt("%c", *p);
 }
 
 static void prepare_amend_commit(struct commit *commit, struct strbuf *sb,