summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Christian Couder <christian.couder@gmail.com>2017-02-27 19:00:00 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-03-01 13:24:21 -0800
commit1f44b09b5891aa0dc30cc7b7fff0d29b985a5af6 (patch)
tree7f3d2049b811565e269e5cec2477ed1b696a4cb9
parentt1700: change here document style (diff)
downloadtgif-1f44b09b5891aa0dc30cc7b7fff0d29b985a5af6.tar.xz
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>
-rw-r--r--cache.h1
-rw-r--r--config.c10
2 files changed, 11 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index a50a61a197..c126fe475e 100644
--- a/cache.h
+++ b/cache.h
@@ -1821,6 +1821,7 @@ extern int git_config_get_bool_or_int(const char *key, int *is_bool, int *dest);
extern int git_config_get_maybe_bool(const char *key, int *dest);
extern int git_config_get_pathname(const char *key, const char **dest);
extern int git_config_get_untracked_cache(void);
+extern int git_config_get_split_index(void);
/*
* This is a hack for test programs like test-dump-untracked-cache to
diff --git a/config.c b/config.c
index 2eaf8ad77a..421e8c9da6 100644
--- a/config.c
+++ b/config.c
@@ -1709,6 +1709,16 @@ int git_config_get_untracked_cache(void)
return -1; /* default value */
}
+int git_config_get_split_index(void)
+{
+ int val;
+
+ if (!git_config_get_maybe_bool("core.splitindex", &val))
+ return val;
+
+ return -1; /* default value */
+}
+
NORETURN
void git_die_config_linenr(const char *key, const char *filename, int linenr)
{