From: Brian Hetro Date: Sat, 5 Jul 2008 05:24:40 +0000 (-0400) Subject: builtin-commit.c: Use 'git_config_string' to get 'commit.template' X-Git-Tag: v1.5.6.3~10^2~7 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=984c6e7ec1f7f6278a207b7d6178962f85130d10;p=git.git builtin-commit.c: Use 'git_config_string' to get 'commit.template' Signed-off-by: Brian Hetro Signed-off-by: Junio C Hamano --- 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); }