diff mbox series

[1/8] config: make `git_parse_maybe_bool_text()` public

Message ID ff9bddbbb31361c372ed7b5942fe8e83a68ac415.1573670565.git.martin.agren@gmail.com (mailing list archive)
State New, archived
Headers show
Series builtin/config: canonicalize "value_regex" with `--type=bool[-or-int]` | expand

Commit Message

Martin Ågren Nov. 13, 2019, 6:55 p.m. UTC
We will soon use it from outside config.c.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 config.c | 2 +-
 config.h | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/config.c b/config.c
index e7052b3977..318711f7a7 100644
--- a/config.c
+++ b/config.c
@@ -1047,7 +1047,7 @@  ssize_t git_config_ssize_t(const char *name, const char *value)
 	return ret;
 }
 
-static int git_parse_maybe_bool_text(const char *value)
+int git_parse_maybe_bool_text(const char *value)
 {
 	if (!value)
 		return 1;
diff --git a/config.h b/config.h
index f0ed464004..343f24c408 100644
--- a/config.h
+++ b/config.h
@@ -95,6 +95,13 @@  int config_with_options(config_fn_t fn, void *,
 int git_parse_ssize_t(const char *, ssize_t *);
 int git_parse_ulong(const char *, unsigned long *);
 int git_parse_maybe_bool(const char *);
+
+/**
+ * Same as `git_parse_maybe_bool`, except that it does not handle
+ * integer values, i.e., those cause this function to return -1.
+ */
+int git_parse_maybe_bool_text(const char *);
+
 int git_config_int(const char *, const char *);
 int64_t git_config_int64(const char *, const char *);
 unsigned long git_config_ulong(const char *, const char *);