@@ -46,7 +46,7 @@ static enum {
4646 COMMIT_PARTIAL ,
4747} commit_style ;
4848
49- static char * logfile , * force_author ;
49+ static const char * logfile , * force_author ;
5050static const char * template_file ;
5151static char * edit_message , * use_message ;
5252static char * author_name , * author_email , * author_date ;
@@ -711,11 +711,14 @@ static int message_is_empty(struct strbuf *sb, int start)
711711}
712712
713713static int parse_and_validate_options (int argc , const char * argv [],
714- const char * const usage [])
714+ const char * const usage [],
715+ const char * prefix )
715716{
716717 int f = 0 ;
717718
718719 argc = parse_options (argc , argv , builtin_commit_options , usage , 0 );
720+ logfile = parse_options_fix_filename (prefix , logfile );
721+ template_file = parse_options_fix_filename (prefix , template_file );
719722
720723 if (logfile || message .len || use_message )
721724 use_editor = 0 ;
@@ -836,7 +839,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
836839 if (wt_status_use_color == -1 )
837840 wt_status_use_color = git_use_color_default ;
838841
839- argc = parse_and_validate_options (argc , argv , builtin_status_usage );
842+ argc = parse_and_validate_options (argc , argv , builtin_status_usage , prefix );
840843
841844 index_file = prepare_index (argc , argv , prefix );
842845
@@ -929,7 +932,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
929932
930933 git_config (git_commit_config , NULL );
931934
932- argc = parse_and_validate_options (argc , argv , builtin_commit_usage );
935+ argc = parse_and_validate_options (argc , argv , builtin_commit_usage , prefix );
933936
934937 index_file = prepare_index (argc , argv , prefix );
935938
0 commit comments