Commit 0774d94d by Carlos Martín Nieto

Store multivars in the multimap

parent fefd4551
...@@ -720,7 +720,7 @@ static int config_parse(diskfile_backend *cfg_file) ...@@ -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) ...@@ -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 */
error = git_hashtable_insert(cfg_file->values, var->key, var); 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; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment