config: add 'git_config_string' to refactor string config variables.
commitea5105a5e3c6629ee64b499ea918c2b80882fc22
authorChristian Couder <chriscool@tuxfamily.org>
Sat, 16 Feb 2008 05:00:24 +0000 (16 06:00 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 16 Feb 2008 05:24:53 +0000 (15 21:24 -0800)
tree3cb732cc384cf3bcbad18a28618e120e29386403
parent2c778210f8877e8f5c88715c2d25d1a43d976566
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>
cache.h
config.c