diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-02-10 14:20:06 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-02-10 14:20:06 -0800 |
commit | 0e35fcb412965f855e5ac6f469343e2f8e28d5ae (patch) | |
tree | e7327947fac2a114a123e00b125bfd24cdc08404 /config.c | |
parent | 81ad6a9c538bdbc24754cab577d8e480a8c5d012 (diff) | |
parent | 7c121788f4c93a29dbec0d61b3cd986a757a5077 (diff) | |
download | git-0e35fcb412965f855e5ac6f469343e2f8e28d5ae.tar.gz git-0e35fcb412965f855e5ac6f469343e2f8e28d5ae.tar.xz |
Merge branch 'cc/untracked'
Update the untracked cache subsystem and change its primary UI from
"git update-index" to "git config".
* cc/untracked:
t7063: add tests for core.untrackedCache
test-dump-untracked-cache: don't modify the untracked cache
config: add core.untrackedCache
dir: simplify untracked cache "ident" field
dir: add remove_untracked_cache()
dir: add {new,add}_untracked_cache()
update-index: move 'uc' var declaration
update-index: add untracked cache notifications
update-index: add --test-untracked-cache
update-index: use enum for untracked cache options
dir: free untracked cache when removing it
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -1594,6 +1594,30 @@ int git_config_get_pathname(const char *key, const char **dest) return ret; } +int git_config_get_untracked_cache(void) +{ + int val = -1; + const char *v; + + /* Hack for test programs like test-dump-untracked-cache */ + if (ignore_untracked_cache_config) + return -1; + + if (!git_config_get_maybe_bool("core.untrackedcache", &val)) + return val; + + if (!git_config_get_value("core.untrackedcache", &v)) { + if (!strcasecmp(v, "keep")) + return -1; + + error("unknown core.untrackedCache value '%s'; " + "using 'keep' default value", v); + return -1; + } + + return -1; /* default value */ +} + NORETURN void git_die_config_linenr(const char *key, const char *filename, int linenr) { |