@@ -20,7 +20,7 @@ static char delim = '=';
2020static char key_delim = ' ' ;
2121static char term = '\n' ;
2222
23- static int use_global_config , use_system_config ;
23+ static int use_global_config , use_system_config , use_local_config ;
2424static const char * given_config_file ;
2525static int actions , types ;
2626static const char * get_color_slot , * get_colorbool_slot ;
@@ -51,6 +51,7 @@ static struct option builtin_config_options[] = {
5151 OPT_GROUP ("Config file location" ),
5252 OPT_BOOLEAN (0 , "global" , & use_global_config , "use global config file" ),
5353 OPT_BOOLEAN (0 , "system" , & use_system_config , "use system config file" ),
54+ OPT_BOOLEAN (0 , "local" , & use_local_config , "use repository config file" ),
5455 OPT_STRING ('f' , "file" , & given_config_file , "FILE" , "use given config file" ),
5556 OPT_GROUP ("Action" ),
5657 OPT_BIT (0 , "get" , & actions , "get value: name [value-regex]" , ACTION_GET ),
@@ -342,7 +343,7 @@ int cmd_config(int argc, const char **argv, const char *unused_prefix)
342343 builtin_config_usage ,
343344 PARSE_OPT_STOP_AT_NON_OPTION );
344345
345- if (use_global_config + use_system_config + !!given_config_file > 1 ) {
346+ if (use_global_config + use_system_config + use_local_config + !!given_config_file > 1 ) {
346347 error ("only one config file at a time." );
347348 usage_with_options (builtin_config_usage , builtin_config_options );
348349 }
@@ -358,6 +359,8 @@ int cmd_config(int argc, const char **argv, const char *unused_prefix)
358359 }
359360 else if (use_system_config )
360361 config_exclusive_filename = git_etc_gitconfig ();
362+ else if (use_local_config )
363+ config_exclusive_filename = git_pathdup ("config" );
361364 else if (given_config_file ) {
362365 if (!is_absolute_path (given_config_file ) && prefix )
363366 config_exclusive_filename = prefix_filename (prefix ,
0 commit comments