string_list: Fix argument order for string_list_append
Update the definition and callers of string_list_append to use the string_list as the first argument. This helps make the string_list API easier to use by being more consistent. Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
e8c8b7139c
commit
1d2f80fa79
@ -745,7 +745,7 @@ static int get_one_remote_for_fetch(struct remote *remote, void *priv)
|
||||
{
|
||||
struct string_list *list = priv;
|
||||
if (!remote->skip_default_update)
|
||||
string_list_append(remote->name, list);
|
||||
string_list_append(list, remote->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -764,8 +764,8 @@ static int get_remote_group(const char *key, const char *value, void *priv)
|
||||
int space = strcspn(value, " \t\n");
|
||||
while (*value) {
|
||||
if (space > 1) {
|
||||
string_list_append(xstrndup(value, space),
|
||||
g->list);
|
||||
string_list_append(g->list,
|
||||
xstrndup(value, space));
|
||||
}
|
||||
value += space + (value[space] != '\0');
|
||||
space = strcspn(value, " \t\n");
|
||||
@ -786,7 +786,7 @@ static int add_remote_or_group(const char *name, struct string_list *list)
|
||||
if (!remote_is_configured(name))
|
||||
return 0;
|
||||
remote = remote_get(name);
|
||||
string_list_append(remote->name, list);
|
||||
string_list_append(list, remote->name);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user