X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin-config.c;h=f672c9cccaeb460a0f0c55ad3e9d2ada95ed1e81;hb=65c6a4696a760f518c9f262705de030323c11146;hp=d98b6c2c4cbbec367e498d33c5f670709dcac893;hpb=2e13e5d89252ceef606a0a7be32dbf5bea7e5aca;p=git.git diff --git a/builtin-config.c b/builtin-config.c index d98b6c2c4..f672c9ccc 100644 --- a/builtin-config.c +++ b/builtin-config.c @@ -81,7 +81,7 @@ static int get_value(const char* key_, const char* regex_) local = repo_config = xstrdup(git_path("config")); if (home) global = xstrdup(mkpath("%s/.gitconfig", home)); - system_wide = ETC_GITCONFIG; + system_wide = git_etc_gitconfig(); } key = xstrdup(key_); @@ -175,7 +175,10 @@ int cmd_config(int argc, const char **argv, const char *prefix) else if (!strcmp(argv[1], "--list") || !strcmp(argv[1], "-l")) { if (argc != 2) usage(git_config_set_usage); - return git_config(show_all_config); + if (git_config(show_all_config) < 0 && file && errno) + die("unable to read config file %s: %s", file, + strerror(errno)); + return 0; } else if (!strcmp(argv[1], "--global")) { char *home = getenv("HOME"); @@ -188,7 +191,7 @@ int cmd_config(int argc, const char **argv, const char *prefix) } } else if (!strcmp(argv[1], "--system")) - setenv(CONFIG_ENVIRONMENT, ETC_GITCONFIG, 1); + setenv(CONFIG_ENVIRONMENT, git_etc_gitconfig(), 1); else if (!strcmp(argv[1], "--file") || !strcmp(argv[1], "-f")) { if (argc < 3) usage(git_config_set_usage);