Skip to content

Commit

Permalink
builtin-commit.c: Use 'git_config_string' to get 'commit.template'
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Hetro <whee@smaertness.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Brian Hetro authored and Junio C Hamano committed Jul 6, 2008
1 parent 7ef8ea7 commit 984c6e7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions builtin-commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 984c6e7

Please sign in to comment.