diff options
Diffstat (limited to 'alias.c')
-rw-r--r-- | alias.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -1,3 +1,5 @@ +#define USE_THE_REPOSITORY_VARIABLE + #include "git-compat-util.h" #include "alias.h" #include "config.h" @@ -21,9 +23,11 @@ static int config_alias_cb(const char *key, const char *value, return 0; if (data->alias) { - if (!strcasecmp(p, data->alias)) - return git_config_string((const char **)&data->v, + if (!strcasecmp(p, data->alias)) { + FREE_AND_NULL(data->v); + return git_config_string(&data->v, key, value); + } } else if (data->list) { string_list_append(data->list, p); } @@ -35,7 +39,7 @@ char *alias_lookup(const char *alias) { struct config_alias_data data = { alias, NULL }; - read_early_config(config_alias_cb, &data); + read_early_config(the_repository, config_alias_cb, &data); return data.v; } @@ -44,7 +48,7 @@ void list_aliases(struct string_list *list) { struct config_alias_data data = { NULL, NULL, list }; - read_early_config(config_alias_cb, &data); + read_early_config(the_repository, config_alias_cb, &data); } void quote_cmdline(struct strbuf *buf, const char **argv) |