aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rw-r--r--config.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/config.c b/config.c
index 4be6c7ba2..3ffe134c5 100644
--- a/config.c
+++ b/config.c
@@ -534,6 +534,15 @@ static int git_parse_int(const char *value, int *ret)
return 1;
}
+static int git_parse_int64(const char *value, int64_t *ret)
+{
+ intmax_t tmp;
+ if (!git_parse_signed(value, &tmp, maximum_signed_value_of_type(int64_t)))
+ return 0;
+ *ret = tmp;
+ return 1;
+}
+
int git_parse_ulong(const char *value, unsigned long *ret)
{
uintmax_t tmp;
@@ -565,6 +574,14 @@ int git_config_int(const char *name, const char *value)
return ret;
}
+int64_t git_config_int64(const char *name, const char *value)
+{
+ int64_t ret;
+ if (!git_parse_int64(value, &ret))
+ die_bad_number(name, value);
+ return ret;
+}
+
unsigned long git_config_ulong(const char *name, const char *value)
{
unsigned long ret;