config: return an error if config_refresh is called on a snapshot Instead of treating it as a no-op, treat it as a programming error and return the same kind of error as if you called to set or delete variables on a snapshot.
diff --git a/src/config_file.c b/src/config_file.c
index a594e51..aa9e83b 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -327,7 +327,7 @@ static int config_refresh(git_config_backend *cfg)
uint32_t i;
if (b->header.parent.readonly)
- return 0;
+ return config_error_readonly();
error = config_is_modified(&modified, &b->file);
if (error < 0 && error != GIT_ENOTFOUND)