mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-09 20:29:27 +00:00
config: set an error message when asked to delete a non-existent key
This commit is contained in:
parent
1835c51f58
commit
1d4dcc4b48
@ -443,8 +443,10 @@ static int config_delete(git_config_file *cfg, const char *name)
|
|||||||
pos = git_strmap_lookup_index(b->values, key);
|
pos = git_strmap_lookup_index(b->values, key);
|
||||||
git__free(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;
|
return GIT_ENOTFOUND;
|
||||||
|
}
|
||||||
|
|
||||||
var = git_strmap_value_at(b->values, pos);
|
var = git_strmap_value_at(b->values, pos);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user