summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2018-02-28 16:01:16 +0100
committerCarlos Martín Nieto <cmn@dwim.me>2018-02-28 16:01:16 +0100
commit9cd0c6f1f1b8dc5fbb5957e1ff3291953b14379e (patch)
tree4ad16644261ae1a561893540790e3ee439f7942c
parent2424e64c4edf55e823fa42c365e4b80f67ed4df6 (diff)
downloadlibgit2-cmn/config-header-common.tar.gz
config: return an error if config_refresh is called on a snapshotcmn/config-header-common
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.
-rw-r--r--src/config_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/config_file.c b/src/config_file.c
index a594e51dd..aa9e83b9c 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)