diff options
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c index 2e341d256..ed7c947ed 100644 --- a/src/config.c +++ b/src/config.c @@ -162,7 +162,16 @@ int git_config_foreach(git_config *cfg, int (*fn)(const char *, const char *, vo int git_config_delete(git_config *cfg, const char *name) { - return git_config_set_string(cfg, name, NULL); + file_internal *internal; + git_config_file *file; + + if (cfg->files.length == 0) + return git__throw(GIT_EINVALIDARGS, "Cannot delete variable; no files open in the `git_config` instance"); + + internal = git_vector_get(&cfg->files, 0); + file = internal->file; + + return file->delete(file, name); } /************** |