]> git.ipfire.org Git - thirdparty/git.git/commitdiff
config: add back code comment
authorKristoffer Haugsbakk <code@khaugsbakk.name>
Sun, 28 Jan 2024 18:31:40 +0000 (19:31 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 Jan 2024 18:27:53 +0000 (10:27 -0800)
c15129b699 (config: factor out global config file retrieval, 2024-01-18)
was a refactor that moved some of the code in this function to
`config.c`. However, in the process I managed to drop this code comment
which explains `$HOME not set`.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/config.c

index 08fe36d4997d896b1378d25bd899d32af3679f64..b55bfae7d66df0cea54313f677e1a924a4a579b3 100644 (file)
@@ -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) {