]> git.ipfire.org Git - thirdparty/git.git/commit - config.c
rewrite git_config() to use the config-set API
authorTanay Abhra <tanayabh@gmail.com>
Thu, 7 Aug 2014 11:59:17 +0000 (04:59 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 7 Aug 2014 18:41:10 +0000 (11:41 -0700)
commit155ef25f12329258c06b8875b5e372abec2d348d
tree8c91e6d847c778f998a29aae2890a3ad36f4edee
parent5a80e97c827e9d73884dbe4119bf97f6dd84b237
rewrite git_config() to use the config-set API

Of all the functions in `git_config*()` family, `git_config()` has the
most invocations in the whole code base. Each `git_config()` invocation
causes config file rereads which can be avoided using the config-set API.

Use the config-set API to rewrite `git_config()` to use the config caching
layer to avoid config file rereads on each invocation during a git process
lifetime. First invocation constructs the cache, and after that for each
successive invocation, `git_config()` feeds values from the config cache
instead of rereading the configuration files.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
config.c
t/t4055-diff-context.sh