]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/update-index.c
repo-settings: parse core.untrackedCache
authorDerrick Stolee <dstolee@microsoft.com>
Tue, 13 Aug 2019 18:37:46 +0000 (11:37 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 13 Aug 2019 20:33:55 +0000 (13:33 -0700)
commitad0fb65999382052cf21408df490d0b39800d487
tree52e75283d8c994de331fe84f9082b6ed6953e564
parent31b1de6a09bad59cc0d88419925486afc7add277
repo-settings: parse core.untrackedCache

The core.untrackedCache config setting is slightly complicated,
so clarify its use and centralize its parsing into the repo
settings.

The default value is "keep" (returned as -1), which persists the
untracked cache if it exists.

If the value is set as "false" (returned as 0), then remove the
untracked cache if it exists.

If the value is set as "true" (returned as 1), then write the
untracked cache and persist it.

Instead of relying on magic values of -1, 0, and 1, split these
options into an enum. This allows the use of "-1" as a
default value. After parsing the config options, if the value is
unset we can initialize it to UNTRACKED_CACHE_KEEP.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/update-index.c
config.c
read-cache.c
repo-settings.c
repository.h