aboutsummaryrefslogtreecommitdiff
path: root/builtin-commit.c
diff options
context:
space:
mode:
authorBrian Hetro <whee@smaertness.net>2008-07-05 01:24:40 -0400
committerJunio C Hamano <gitster@pobox.com>2008-07-05 17:42:54 -0700
commit984c6e7ec1f7f6278a207b7d6178962f85130d10 (patch)
tree78ac2dea73b85778654108ba01116fbd794e476e /builtin-commit.c
parent7ef8ea7035a3be4a97259e53e8dd3c1b8fd81ac0 (diff)
downloadgit-984c6e7ec1f7f6278a207b7d6178962f85130d10.tar.gz
git-984c6e7ec1f7f6278a207b7d6178962f85130d10.tar.xz
builtin-commit.c: Use 'git_config_string' to get 'commit.template'
Signed-off-by: Brian Hetro <whee@smaertness.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-commit.c')
-rw-r--r--builtin-commit.c11
1 files changed, 4 insertions, 7 deletions
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);
}