mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-28 13:36:17 +00:00
Revert "config: Return ENOTFOUND when a variable was deleted"
This would make us think that config variables like [core] something is missing.
This commit is contained in:
parent
2ea14da648
commit
7b2b4adfb1
@ -391,15 +391,17 @@ static int config_set(git_config_file *cfg, const char *name, const char *value)
|
||||
static int config_get(git_config_file *cfg, const char *name, const char **out)
|
||||
{
|
||||
cvar_t *var;
|
||||
int error = GIT_SUCCESS;
|
||||
diskfile_backend *b = (diskfile_backend *)cfg;
|
||||
|
||||
var = cvar_list_find(&b->var_list, name);
|
||||
|
||||
if (var == NULL || var->value == NULL)
|
||||
if (var == NULL)
|
||||
return git__throw(GIT_ENOTFOUND, "Variable '%s' not found", name);
|
||||
|
||||
*out = var->value;
|
||||
return GIT_SUCCESS;
|
||||
|
||||
return error == GIT_SUCCESS ? GIT_SUCCESS : git__rethrow(error, "Failed to get config value for %s", name);
|
||||
}
|
||||
|
||||
int git_config_file__ondisk(git_config_file **out, const char *path)
|
||||
|
Loading…
Reference in New Issue
Block a user