Commit ad5adacb1d1913620f022d7bb6c9b877ff3a4faf

Alan Rogers 2014-10-21T09:29:45

Patch from @carlosmn to refresh the parent config before snapshotting.

diff --git a/src/config_file.c b/src/config_file.c
index 8f55c42..1f73e7e 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;