diff options
| author | Carlos Martín Nieto <cmn@elego.de> | 2012-06-01 11:48:58 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@elego.de> | 2012-06-01 11:48:58 +0200 |
| commit | 1d4dcc4b48f9b60c70aefc791da500b4ff16ae7d (patch) | |
| tree | 033e3cf3a6b65bf72cdba5acda512c3bf960a155 /src/config_file.c | |
| parent | 1835c51f58a670e23c9546f942259d53fe626fa2 (diff) | |
| download | libgit2-1d4dcc4b48f9b60c70aefc791da500b4ff16ae7d.tar.gz | |
config: set an error message when asked to delete a non-existent key
Diffstat (limited to 'src/config_file.c')
| -rw-r--r-- | src/config_file.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/config_file.c b/src/config_file.c index cbc48bcd9..1c748fad1 100644 --- a/src/config_file.c +++ b/src/config_file.c @@ -443,8 +443,10 @@ static int config_delete(git_config_file *cfg, const char *name) pos = git_strmap_lookup_index(b->values, key); git__free(key); - if (!git_strmap_valid_index(b->values, pos)) + if (!git_strmap_valid_index(b->values, pos)) { + giterr_set(GITERR_CONFIG, "Could not find key '%s' to delete", name); return GIT_ENOTFOUND; + } var = git_strmap_value_at(b->values, pos); |
