|
1 | 1 | #include "builtin.h"
|
2 | 2 | #include "cache.h"
|
| 3 | +#include "config.h" |
3 | 4 | #include "color.h"
|
4 | 5 | #include "parse-options.h"
|
5 | 6 | #include "urlmatch.h"
|
@@ -242,8 +243,8 @@ static int get_value(const char *key_, const char *regex_)
|
242 | 243 | }
|
243 | 244 | }
|
244 | 245 |
|
245 |
| - git_config_with_options(collect_config, &values, |
246 |
| - &given_config_source, &config_options); |
| 246 | + config_with_options(collect_config, &values, |
| 247 | + &given_config_source, &config_options); |
247 | 248 |
|
248 | 249 | ret = !values.nr;
|
249 | 250 |
|
@@ -320,8 +321,8 @@ static void get_color(const char *var, const char *def_color)
|
320 | 321 | get_color_slot = var;
|
321 | 322 | get_color_found = 0;
|
322 | 323 | parsed_color[0] = '\0';
|
323 |
| - git_config_with_options(git_get_color_config, NULL, |
324 |
| - &given_config_source, &config_options); |
| 324 | + config_with_options(git_get_color_config, NULL, |
| 325 | + &given_config_source, &config_options); |
325 | 326 |
|
326 | 327 | if (!get_color_found && def_color) {
|
327 | 328 | if (color_parse(def_color, parsed_color) < 0)
|
@@ -352,8 +353,8 @@ static int get_colorbool(const char *var, int print)
|
352 | 353 | get_colorbool_found = -1;
|
353 | 354 | get_diff_color_found = -1;
|
354 | 355 | get_color_ui_found = -1;
|
355 |
| - git_config_with_options(git_get_colorbool_config, NULL, |
356 |
| - &given_config_source, &config_options); |
| 356 | + config_with_options(git_get_colorbool_config, NULL, |
| 357 | + &given_config_source, &config_options); |
357 | 358 |
|
358 | 359 | if (get_colorbool_found < 0) {
|
359 | 360 | if (!strcmp(get_colorbool_slot, "color.diff"))
|
@@ -441,8 +442,8 @@ static int get_urlmatch(const char *var, const char *url)
|
441 | 442 | show_keys = 1;
|
442 | 443 | }
|
443 | 444 |
|
444 |
| - git_config_with_options(urlmatch_config_entry, &config, |
445 |
| - &given_config_source, &config_options); |
| 445 | + config_with_options(urlmatch_config_entry, &config, |
| 446 | + &given_config_source, &config_options); |
446 | 447 |
|
447 | 448 | ret = !values.nr;
|
448 | 449 |
|
@@ -538,6 +539,10 @@ int cmd_config(int argc, const char **argv, const char *prefix)
|
538 | 539 | config_options.respect_includes = !given_config_source.file;
|
539 | 540 | else
|
540 | 541 | config_options.respect_includes = respect_includes_opt;
|
| 542 | + if (!nongit) { |
| 543 | + config_options.commondir = get_git_common_dir(); |
| 544 | + config_options.git_dir = get_git_dir(); |
| 545 | + } |
541 | 546 |
|
542 | 547 | if (end_null) {
|
543 | 548 | term = '\0';
|
@@ -582,9 +587,9 @@ int cmd_config(int argc, const char **argv, const char *prefix)
|
582 | 587 |
|
583 | 588 | if (actions == ACTION_LIST) {
|
584 | 589 | check_argc(argc, 0, 0);
|
585 |
| - if (git_config_with_options(show_all_config, NULL, |
586 |
| - &given_config_source, |
587 |
| - &config_options) < 0) { |
| 590 | + if (config_with_options(show_all_config, NULL, |
| 591 | + &given_config_source, |
| 592 | + &config_options) < 0) { |
588 | 593 | if (given_config_source.file)
|
589 | 594 | die_errno("unable to read config file '%s'",
|
590 | 595 | given_config_source.file);
|
|
0 commit comments