Message ID | 24f536d575d508b0784e0adf647cb2334f6704d8.1706550761.git.code@khaugsbakk.name (mailing list archive) |
---|---|
State | Accepted |
Commit | 1cb3b92fc6540007c62c300f33b501681dc4f897 |
Headers | show |
Series | config: add back code comment | expand |
diff --git a/builtin/config.c b/builtin/config.c index 08fe36d499..b55bfae7d6 100644 --- a/builtin/config.c +++ b/builtin/config.c @@ -710,6 +710,12 @@ int cmd_config(int argc, const char **argv, const char *prefix) if (use_global_config) { given_config_source.file = git_global_config(); if (!given_config_source.file) + /* + * It is unknown if HOME/.gitconfig exists, so + * we do not know if we should write to XDG + * location; error out even if XDG_CONFIG_HOME + * is set and points at a sane location. + */ die(_("$HOME not set")); given_config_source.scope = CONFIG_SCOPE_GLOBAL; } else if (use_system_config) {