]> git.proxmox.com Git - libgit2.git/commitdiff
config: set an error message when asked to delete a non-existent key
authorCarlos Martín Nieto <cmn@elego.de>
Fri, 1 Jun 2012 09:48:58 +0000 (11:48 +0200)
committerCarlos Martín Nieto <cmn@elego.de>
Fri, 1 Jun 2012 09:48:58 +0000 (11:48 +0200)
src/config_file.c

index cbc48bcd92f2565cca327d16c9a8b560faa7c062..1c748fad11cb70c87c17324dc497848bb772107d 100644 (file)
@@ -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);