summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2008-02-16 06:00:24 +0100
committerJunio C Hamano <gitster@pobox.com>2008-02-15 21:24:53 -0800
commitea5105a5e3c6629ee64b499ea918c2b80882fc22 (patch)
tree3cb732cc384cf3bcbad18a28618e120e29386403 /cache.h
parent2c778210f8877e8f5c88715c2d25d1a43d976566 (diff)
downloadgit-ea5105a5e3c6629ee64b499ea918c2b80882fc22.tar.gz
config: add 'git_config_string' to refactor string config variables.
In many places we just check if a value from the config file is not NULL, then we duplicate it and return 0. This patch introduces the new 'git_config_string' function to do that. This function is also used to refactor some code in 'config.c'. Refactoring other files is left for other patches. Also not all the code in "config.c" is refactored, because the function takes a "const char **" as its first parameter, but in many places a "char *" is used instead of a "const char *". (And C does not allow using a "char **" instead of a "const char **" without a warning.) Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 6abcee4372..c83b123fa5 100644
--- a/cache.h
+++ b/cache.h
@@ -584,6 +584,7 @@ extern int git_parse_ulong(const char *, unsigned long *);
extern int git_config_int(const char *, const char *);
extern unsigned long git_config_ulong(const char *, const char *);
extern int git_config_bool(const char *, const char *);
+extern int git_config_string(const char **, const char *, const char *);
extern int git_config_set(const char *, const char *);
extern int git_config_set_multivar(const char *, const char *, const char *, int);
extern int git_config_rename_section(const char *, const char *);