From ad5adacb1d1913620f022d7bb6c9b877ff3a4faf Mon Sep 17 00:00:00 2001 From: Alan Rogers Date: Tue, 21 Oct 2014 09:29:45 +1100 Subject: [PATCH] Patch from @carlosmn to refresh the parent config before snapshotting. --- src/config_file.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/config_file.c b/src/config_file.c index 8f55c42f3..1f73e7e11 100644 --- a/src/config_file.c +++ b/src/config_file.c @@ -767,12 +767,17 @@ static int config_readonly_open(git_config_backend *cfg, git_config_level_t leve { diskfile_readonly_backend *b = (diskfile_readonly_backend *) cfg; diskfile_backend *src = b->snapshot_from; + diskfile_header *src_header = &src->header; refcounted_strmap *src_map; + int error; + + if (!src_header->readonly && (error = config_refresh(&src_header->parent)) < 0) + return error; /* We're just copying data, don't care about the level */ GIT_UNUSED(level); - src_map = refcounted_strmap_take(&src->header); + src_map = refcounted_strmap_take(src_header); b->header.values = src_map; return 0;