Skip to content

Commit

Permalink
config: make git_config_parse_parameter a public function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Jun 22, 2011
1 parent 615ff91 commit 2496844
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2496844

Please sign in to comment.