]> git.99rst.org Git - git.git/commit
config: teach repo_config to allow `repo` to be NULL
authorUsman Akinyemi <redacted>
Fri, 7 Mar 2025 23:35:00 +0000 (05:05 +0530)
committerJunio C Hamano <redacted>
Sat, 8 Mar 2025 00:52:00 +0000 (16:52 -0800)
commitf29f1990b5605f8dbed65324d8e92b67d4dd1713
tree79af710cfe1516c2b9cd53faac911f2369ce62e3
parente969bc875963a10890d61ba84eab3a460bd9e535
config: teach repo_config to allow `repo` to be NULL

The `repo` value can be NULL if a builtin command is run outside
any repository. The current implementation of `repo_config()` will
fail if `repo` is NULL.

If the `repo` is NULL the `repo_config()` can ignore the repository
configuration but it should read the other configuration sources like
the system-side configuration instead of failing.

Teach the `repo_config()` to allow `repo` to be NULL by calling the
`read_very_early_config()` which read config but only enumerate system
and global settings.

This will be useful in the following commits.

Suggested-by: Junio C Hamano <redacted>
Mentored-by: Christian Couder <redacted>
Signed-off-by: Usman Akinyemi <redacted>
Signed-off-by: Junio C Hamano <redacted>
config.c
config.h
git clone https://git.99rst.org/PROJECT