X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-commit.c;h=bcbea3893b6ddb40388f5a5ab49b022af5a88df1;hb=a70c232e0fcb1a72cec024def0f8b1377f15daf4;hp=90200ed643bcf21f28a66396f0d15db920a5d4c8;hpb=196821f440d46029f0399a7d97c0cfc78a870244;p=git.git diff --git a/builtin-commit.c b/builtin-commit.c index 90200ed64..bcbea3893 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -45,7 +45,8 @@ static enum { COMMIT_PARTIAL, } commit_style; -static char *logfile, *force_author, *template_file; +static char *logfile, *force_author; +static const char *template_file; static char *edit_message, *use_message; static char *author_name, *author_email, *author_date; static int all, edit_flag, also, interactive, only, amend, signoff; @@ -864,12 +865,8 @@ static void print_summary(const char *prefix, const unsigned char *sha1) int git_commit_config(const char *k, const char *v, void *cb) { - if (!strcmp(k, "commit.template")) { - if (!v) - return config_error_nonbool(v); - template_file = xstrdup(v); - return 0; - } + if (!strcmp(k, "commit.template")) + return git_config_string(&template_file, k, v); return git_status_config(k, v, cb); }