mirror of
https://git.proxmox.com/git/libgit2
synced 2025-07-04 05:48:34 +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 *current_section = NULL;
|
||||||
char *var_name;
|
char *var_name;
|
||||||
char *var_value;
|
char *var_value;
|
||||||
cvar_t *var;
|
cvar_t *var, *existing;
|
||||||
git_buf buf = GIT_BUF_INIT;
|
git_buf buf = GIT_BUF_INIT;
|
||||||
|
|
||||||
/* Initialize the reading position */
|
/* Initialize the reading position */
|
||||||
@ -779,8 +779,16 @@ static int config_parse(diskfile_backend *cfg_file)
|
|||||||
var->key = git_buf_detach(&buf);
|
var->key = git_buf_detach(&buf);
|
||||||
var->value = var_value;
|
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);
|
error = git_hashtable_insert(cfg_file->values, var->key, var);
|
||||||
|
} else {
|
||||||
|
while (existing->next != NULL) {
|
||||||
|
existing = existing->next;
|
||||||
|
}
|
||||||
|
existing->next = var;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user