mirror of
https://git.proxmox.com/git/libgit2
synced 2025-07-02 04:43:39 +00:00
Store multivars in the multimap
This commit is contained in:
parent
fefd4551a5
commit
0774d94d31
@ -720,7 +720,7 @@ static int config_parse(diskfile_backend *cfg_file)
|
||||
char *current_section = NULL;
|
||||
char *var_name;
|
||||
char *var_value;
|
||||
cvar_t *var;
|
||||
cvar_t *var, *existing;
|
||||
git_buf buf = GIT_BUF_INIT;
|
||||
|
||||
/* Initialize the reading position */
|
||||
@ -779,8 +779,16 @@ static int config_parse(diskfile_backend *cfg_file)
|
||||
var->key = git_buf_detach(&buf);
|
||||
var->value = var_value;
|
||||
|
||||
/* FIXME: Actually support multivars, don't just overwrite */
|
||||
/* Add or append the new config option */
|
||||
existing = git_hashtable_lookup(cfg_file->values, var->key);
|
||||
if (existing == NULL) {
|
||||
error = git_hashtable_insert(cfg_file->values, var->key, var);
|
||||
} else {
|
||||
while (existing->next != NULL) {
|
||||
existing = existing->next;
|
||||
}
|
||||
existing->next = var;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user