@@ -20,7 +20,7 @@ static char delim = '=';
20
20
static char key_delim = ' ' ;
21
21
static char term = '\n' ;
22
22
23
- static int use_global_config , use_system_config ;
23
+ static int use_global_config , use_system_config , use_local_config ;
24
24
static const char * given_config_file ;
25
25
static int actions , types ;
26
26
static const char * get_color_slot , * get_colorbool_slot ;
@@ -51,6 +51,7 @@ static struct option builtin_config_options[] = {
51
51
OPT_GROUP ("Config file location" ),
52
52
OPT_BOOLEAN (0 , "global" , & use_global_config , "use global config file" ),
53
53
OPT_BOOLEAN (0 , "system" , & use_system_config , "use system config file" ),
54
+ OPT_BOOLEAN (0 , "local" , & use_local_config , "use repository config file" ),
54
55
OPT_STRING ('f' , "file" , & given_config_file , "FILE" , "use given config file" ),
55
56
OPT_GROUP ("Action" ),
56
57
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)
342
343
builtin_config_usage ,
343
344
PARSE_OPT_STOP_AT_NON_OPTION );
344
345
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 ) {
346
347
error ("only one config file at a time." );
347
348
usage_with_options (builtin_config_usage , builtin_config_options );
348
349
}
@@ -358,6 +359,8 @@ int cmd_config(int argc, const char **argv, const char *unused_prefix)
358
359
}
359
360
else if (use_system_config )
360
361
config_exclusive_filename = git_etc_gitconfig ();
362
+ else if (use_local_config )
363
+ config_exclusive_filename = git_pathdup ("config" );
361
364
else if (given_config_file ) {
362
365
if (!is_absolute_path (given_config_file ) && prefix )
363
366
config_exclusive_filename = prefix_filename (prefix ,
0 commit comments