config: add git_config_get_split_index()
This new function will be used in a following commit to know if we want to use the split index feature or not. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Christian Couder committed
Feb 27, 2017 at 19:00 UTC
1f44b09b5891aa0dc30cc7b7fff0d29b985a5af6
2 files changed
+11
cache.h
+1
@@ -1821,6 +1821,7 @@ extern int git_config_get_bool_or_int(const char *key, int *is_bool, int *dest);
1821
extern int git_config_get_maybe_bool(const char *key, int *dest);
1822
extern int git_config_get_pathname(const char *key, const char **dest);
1823
extern int git_config_get_untracked_cache(void);
1824
+extern int git_config_get_split_index(void);
1825
1826
/*
1827
* This is a hack for test programs like test-dump-untracked-cache to
config.c
+10
@@ -1709,6 +1709,16 @@ int git_config_get_untracked_cache(void)
1709
return -1; /* default value */
1710
}
1711
1712
+int git_config_get_split_index(void)
1713
+{
1714
+ int val;
1715
+
1716
+ if (!git_config_get_maybe_bool("core.splitindex", &val))
1717
+ return val;
1718
+
1719
+ return -1; /* default value */
1720
+}
1721
+
1722
NORETURN
1723
void git_die_config_linenr(const char *key, const char *filename, int linenr)
1724
{