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>
Brian Hetro committed
Jul 5, 2008 at 01:24 UTC
984c6e7ec1f7f6278a207b7d6178962f85130d10
1 file changed
+4
-7
builtin-commit.c
+4
-7
@@ -45,7 +45,8 @@ static enum {
45
COMMIT_PARTIAL,
46
} commit_style;
47
48
-static char *logfile, *force_author, *template_file;
48
+static char *logfile, *force_author;
49
+static const char *template_file;
50
static char *edit_message, *use_message;
51
static char *author_name, *author_email, *author_date;
52
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)
865
866
int git_commit_config(const char *k, const char *v, void *cb)
867
{
867
- if (!strcmp(k, "commit.template")) {
868
- if (!v)
869
- return config_error_nonbool(v);
870
- template_file = xstrdup(v);
871
- return 0;
872
- }
868
+ if (!strcmp(k, "commit.template"))
869
+ return git_config_string(&template_file, k, v);
870
871
return git_status_config(k, v, cb);
872
}