@@ -26,7 +26,8 @@ static int use_global_config, use_system_config, use_local_config;
26
26
static struct git_config_source given_config_source ;
27
27
static int actions , types ;
28
28
static int end_null ;
29
- static int respect_includes = -1 ;
29
+ static int respect_includes_opt = -1 ;
30
+ static struct config_options config_options ;
30
31
static int show_origin ;
31
32
32
33
#define ACTION_GET (1<<0)
@@ -81,7 +82,7 @@ static struct option builtin_config_options[] = {
81
82
OPT_GROUP (N_ ("Other" )),
82
83
OPT_BOOL ('z' , "null" , & end_null , N_ ("terminate values with NUL byte" )),
83
84
OPT_BOOL (0 , "name-only" , & omit_values , N_ ("show variable names only" )),
84
- OPT_BOOL (0 , "includes" , & respect_includes , N_ ("respect include directives on lookup" )),
85
+ OPT_BOOL (0 , "includes" , & respect_includes_opt , N_ ("respect include directives on lookup" )),
85
86
OPT_BOOL (0 , "show-origin" , & show_origin , N_ ("show origin of config (file, standard input, blob, command line)" )),
86
87
OPT_END (),
87
88
};
@@ -242,7 +243,7 @@ static int get_value(const char *key_, const char *regex_)
242
243
}
243
244
244
245
git_config_with_options (collect_config , & values ,
245
- & given_config_source , respect_includes );
246
+ & given_config_source , & config_options );
246
247
247
248
ret = !values .nr ;
248
249
@@ -320,7 +321,7 @@ static void get_color(const char *var, const char *def_color)
320
321
get_color_found = 0 ;
321
322
parsed_color [0 ] = '\0' ;
322
323
git_config_with_options (git_get_color_config , NULL ,
323
- & given_config_source , respect_includes );
324
+ & given_config_source , & config_options );
324
325
325
326
if (!get_color_found && def_color ) {
326
327
if (color_parse (def_color , parsed_color ) < 0 )
@@ -352,7 +353,7 @@ static int get_colorbool(const char *var, int print)
352
353
get_diff_color_found = -1 ;
353
354
get_color_ui_found = -1 ;
354
355
git_config_with_options (git_get_colorbool_config , NULL ,
355
- & given_config_source , respect_includes );
356
+ & given_config_source , & config_options );
356
357
357
358
if (get_colorbool_found < 0 ) {
358
359
if (!strcmp (get_colorbool_slot , "color.diff" ))
@@ -441,7 +442,7 @@ static int get_urlmatch(const char *var, const char *url)
441
442
}
442
443
443
444
git_config_with_options (urlmatch_config_entry , & config ,
444
- & given_config_source , respect_includes );
445
+ & given_config_source , & config_options );
445
446
446
447
ret = !values .nr ;
447
448
@@ -530,8 +531,10 @@ int cmd_config(int argc, const char **argv, const char *prefix)
530
531
prefix_filename (prefix , given_config_source .file );
531
532
}
532
533
533
- if (respect_includes == -1 )
534
- respect_includes = !given_config_source .file ;
534
+ if (respect_includes_opt == -1 )
535
+ config_options .respect_includes = !given_config_source .file ;
536
+ else
537
+ config_options .respect_includes = respect_includes_opt ;
535
538
536
539
if (end_null ) {
537
540
term = '\0' ;
@@ -578,7 +581,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
578
581
check_argc (argc , 0 , 0 );
579
582
if (git_config_with_options (show_all_config , NULL ,
580
583
& given_config_source ,
581
- respect_includes ) < 0 ) {
584
+ & config_options ) < 0 ) {
582
585
if (given_config_source .file )
583
586
die_errno ("unable to read config file '%s'" ,
584
587
given_config_source .file );
0 commit comments