Skip to content

Commit

Permalink
config: add git_config_get_split_index()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
chriscool authored and gitster committed Mar 1, 2017
1 parent 5662176 commit 1f44b09
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 1f44b09

Please sign in to comment.