diff options
author | Christian Couder <christian.couder@gmail.com> | 2017-02-27 19:00:07 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-01 13:24:22 -0800 |
commit | 72dcb7b3607e3349ac3367dc804b62ce1556842b (patch) | |
tree | 82ba8d6b770ea7726a877f8d17f791acbc4391a7 /config.c | |
parent | 13c0e4c4782976fbda24fdde31d67ef29f41cb34 (diff) | |
download | git-72dcb7b3607e3349ac3367dc804b62ce1556842b.tar.gz |
config: add git_config_get_max_percent_split_change()
This new function will be used in a following commit to get the
value of the "splitIndex.maxPercentChange" config variable.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -1719,6 +1719,21 @@ int git_config_get_split_index(void) return -1; /* default value */ } +int git_config_get_max_percent_split_change(void) +{ + int val = -1; + + if (!git_config_get_int("splitindex.maxpercentchange", &val)) { + if (0 <= val && val <= 100) + return val; + + return error(_("splitIndex.maxPercentChange value '%d' " + "should be between 0 and 100"), val); + } + + return -1; /* default value */ +} + NORETURN void git_die_config_linenr(const char *key, const char *filename, int linenr) { |