diff options
| author | Alan Rogers <alanjrogers@me.com> | 2014-10-21 09:29:45 +1100 |
|---|---|---|
| committer | Alan Rogers <alanjrogers@me.com> | 2014-10-23 15:21:30 +1100 |
| commit | ad5adacb1d1913620f022d7bb6c9b877ff3a4faf (patch) | |
| tree | 524a458a3f73de054f9558d4443b76f44dd41908 | |
| parent | 1e2fe921a5fc8ad8188b69956179703f10d0a4ad (diff) | |
| download | libgit2-ad5adacb1d1913620f022d7bb6c9b877ff3a4faf.tar.gz | |
Patch from @carlosmn to refresh the parent config before snapshotting.refresh-config-snapshot
| -rw-r--r-- | src/config_file.c | 7 |
1 files changed, 6 insertions, 1 deletions
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; |
