summaryrefslogtreecommitdiff
path: root/builtin-commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-08-06 13:50:42 -0700
committerJunio C Hamano <gitster@pobox.com>2008-08-06 13:50:48 -0700
commitf44bc33c7283c19a86797ffdaafd22a19bbdfbd6 (patch)
tree9e33941160873fda6e65de8c94fa3a4178631c0f /builtin-commit.c
parentd96ca27e1089a190139591ac365873f26bffcf5c (diff)
parent781c1834f5419bdf81bb7f3750170ccd6b809174 (diff)
downloadgit-f44bc33c7283c19a86797ffdaafd22a19bbdfbd6.tar.gz
Sync with 1.5.6.5
Diffstat (limited to 'builtin-commit.c')
-rw-r--r--builtin-commit.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/builtin-commit.c b/builtin-commit.c
index b783e6eb46..649c8beb3e 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -46,7 +46,7 @@ static enum {
COMMIT_PARTIAL,
} commit_style;
-static char *logfile, *force_author;
+static const char *logfile, *force_author;
static const char *template_file;
static char *edit_message, *use_message;
static char *author_name, *author_email, *author_date;
@@ -711,11 +711,14 @@ static int message_is_empty(struct strbuf *sb, int start)
}
static int parse_and_validate_options(int argc, const char *argv[],
- const char * const usage[])
+ const char * const usage[],
+ const char *prefix)
{
int f = 0;
argc = parse_options(argc, argv, builtin_commit_options, usage, 0);
+ logfile = parse_options_fix_filename(prefix, logfile);
+ template_file = parse_options_fix_filename(prefix, template_file);
if (logfile || message.len || use_message)
use_editor = 0;
@@ -836,7 +839,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
if (wt_status_use_color == -1)
wt_status_use_color = git_use_color_default;
- argc = parse_and_validate_options(argc, argv, builtin_status_usage);
+ argc = parse_and_validate_options(argc, argv, builtin_status_usage, prefix);
index_file = prepare_index(argc, argv, prefix);
@@ -929,7 +932,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
git_config(git_commit_config, NULL);
- argc = parse_and_validate_options(argc, argv, builtin_commit_usage);
+ argc = parse_and_validate_options(argc, argv, builtin_commit_usage, prefix);
index_file = prepare_index(argc, argv, prefix);