OSDN Git Service

config: make git_config_parse_parameter a public function
authorJeff King <peff@peff.net>
Thu, 9 Jun 2011 15:56:42 +0000 (11:56 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 22 Jun 2011 18:25:21 +0000 (11:25 -0700)
We use this internally to parse "git -c core.foo=bar", but
the general format of "key=value" is useful for other
places.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
config.c

diff --git a/cache.h b/cache.h
index ce73e1f..fce9bc0 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -1030,6 +1030,8 @@ extern int config_error_nonbool(const char *);
 extern const char *get_log_output_encoding(void);
 extern const char *get_commit_output_encoding(void);
 
+extern int git_config_parse_parameter(const char *, config_fn_t fn, void *data);
+
 extern const char *config_exclusive_filename;
 
 #define MAX_GITNAME (1000)
index 44b2c93..a1f3b59 100644 (file)
--- a/config.c
+++ b/config.c
@@ -39,8 +39,8 @@ void git_config_push_parameter(const char *text)
        strbuf_release(&env);
 }
 
-static int git_config_parse_parameter(const char *text,
-                                     config_fn_t fn, void *data)
+int git_config_parse_parameter(const char *text,
+                              config_fn_t fn, void *data)
 {
        struct strbuf **pair;
        pair = strbuf_split_str(text, '=', 2);