Skip to content

Commit 1cb3b92

Browse files
LemmingAvalanchegitster
authored andcommitted
config: add back code comment
c15129b (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 <[email protected]> Acked-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 74e1219 commit 1cb3b92

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

builtin/config.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,12 @@ int cmd_config(int argc, const char **argv, const char *prefix)
710710
if (use_global_config) {
711711
given_config_source.file = git_global_config();
712712
if (!given_config_source.file)
713+
/*
714+
* It is unknown if HOME/.gitconfig exists, so
715+
* we do not know if we should write to XDG
716+
* location; error out even if XDG_CONFIG_HOME
717+
* is set and points at a sane location.
718+
*/
713719
die(_("$HOME not set"));
714720
given_config_source.scope = CONFIG_SCOPE_GLOBAL;
715721
} else if (use_system_config) {

0 commit comments

Comments
 (0)