]> git.ipfire.org Git - thirdparty/git.git/commit - t/t7900-maintenance.sh
maintenance: use XDG config if it exists
authorKristoffer Haugsbakk <code@khaugsbakk.name>
Thu, 18 Jan 2024 16:12:52 +0000 (17:12 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 18 Jan 2024 20:17:42 +0000 (12:17 -0800)
commit74e12192e6d2c7747c411261aee247a7479d5703
tree258f00f75c769e52dffb84d22880d9710e98b1ea
parentc15129b699d9b225e916b84f542b9d3665fccc3d
maintenance: use XDG config if it exists

`git maintenance register` registers the repository in the user's global
config. `$XDG_CONFIG_HOME/git/config` is supposed to be used if
`~/.gitconfig` does not exist. However, this command creates a
`~/.gitconfig` file and writes to that one even though the XDG variant
exists.

This used to work correctly until 50a044f1e4 (gc: replace config
subprocesses with API calls, 2022-09-27), when the command started calling
the config API instead of git-config(1).

Also change `unregister` accordingly.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/gc.c
t/t7900-maintenance.sh