diff options
author | Russell Belfer <rb@github.com> | 2013-04-23 03:24:53 +0400 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-04-23 23:57:30 +0400 |
commit | 6be368bf16c86380ea84d7e39b65e0ebd9606174 (patch) | |
tree | 468d609d86ce9266e34e6e314a5fb404151094a2 /src/config.c | |
parent | eac76c230c92594eaa528e50746119bd3c33ffbb (diff) |
Clear repo config cache when cfgs are set
This is a conservative change, but it seemed like the only safe
thing to do -- i.e. clear the cvar cache when a config gets set.
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c index cb9d4014c..3c0bbe9a7 100644 --- a/src/config.c +++ b/src/config.c @@ -363,6 +363,7 @@ int git_config_set_bool(git_config *cfg, const char *name, int value) int git_config_set_string(git_config *cfg, const char *name, const char *value) { + int error; git_config_backend *file; file_internal *internal; @@ -374,7 +375,12 @@ int git_config_set_string(git_config *cfg, const char *name, const char *value) internal = git_vector_get(&cfg->files, 0); file = internal->file; - return file->set(file, name, value); + error = file->set(file, name, value); + + if (!error && GIT_REFCOUNT_OWNER(cfg) != NULL) + git_repository__cvar_cache_clear(GIT_REFCOUNT_OWNER(cfg)); + + return error; } /*********** |