Skip to content

Commit 9cd0c6f

Browse files
committed
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.
1 parent 2424e64 commit 9cd0c6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/config_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ static int config_refresh(git_config_backend *cfg)
327327
uint32_t i;
328328

329329
if (b->header.parent.readonly)
330-
return 0;
330+
return config_error_readonly();
331331

332332
error = config_is_modified(&modified, &b->file);
333333
if (error < 0 && error != GIT_ENOTFOUND)

0 commit comments

Comments
 (0)