Merge branch 'jp/string-list-api-cleanup'
* jp/string-list-api-cleanup: string_list: Fix argument order for string_list_append string_list: Fix argument order for string_list_lookup string_list: Fix argument order for string_list_insert_at_index string_list: Fix argument order for string_list_insert string_list: Fix argument order for for_each_string_list string_list: Fix argument order for print_string_list
This commit is contained in:
@ -535,13 +535,13 @@ static void add_header(const char *value)
|
||||
len--;
|
||||
|
||||
if (!strncasecmp(value, "to: ", 4)) {
|
||||
item = string_list_append(value + 4, &extra_to);
|
||||
item = string_list_append(&extra_to, value + 4);
|
||||
len -= 4;
|
||||
} else if (!strncasecmp(value, "cc: ", 4)) {
|
||||
item = string_list_append(value + 4, &extra_cc);
|
||||
item = string_list_append(&extra_cc, value + 4);
|
||||
len -= 4;
|
||||
} else {
|
||||
item = string_list_append(value, &extra_hdr);
|
||||
item = string_list_append(&extra_hdr, value);
|
||||
}
|
||||
|
||||
item->string[len] = '\0';
|
||||
@ -566,13 +566,13 @@ static int git_format_config(const char *var, const char *value, void *cb)
|
||||
if (!strcmp(var, "format.to")) {
|
||||
if (!value)
|
||||
return config_error_nonbool(var);
|
||||
string_list_append(value, &extra_to);
|
||||
string_list_append(&extra_to, value);
|
||||
return 0;
|
||||
}
|
||||
if (!strcmp(var, "format.cc")) {
|
||||
if (!value)
|
||||
return config_error_nonbool(var);
|
||||
string_list_append(value, &extra_cc);
|
||||
string_list_append(&extra_cc, value);
|
||||
return 0;
|
||||
}
|
||||
if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) {
|
||||
@ -959,7 +959,7 @@ static int to_callback(const struct option *opt, const char *arg, int unset)
|
||||
if (unset)
|
||||
string_list_clear(&extra_to, 0);
|
||||
else
|
||||
string_list_append(arg, &extra_to);
|
||||
string_list_append(&extra_to, arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -968,7 +968,7 @@ static int cc_callback(const struct option *opt, const char *arg, int unset)
|
||||
if (unset)
|
||||
string_list_clear(&extra_cc, 0);
|
||||
else
|
||||
string_list_append(arg, &extra_cc);
|
||||
string_list_append(&extra_cc, arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1251,7 +1251,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
|
||||
rev.ref_message_ids = xcalloc(1, sizeof(struct string_list));
|
||||
if (in_reply_to) {
|
||||
const char *msgid = clean_message_id(in_reply_to);
|
||||
string_list_append(msgid, rev.ref_message_ids);
|
||||
string_list_append(rev.ref_message_ids, msgid);
|
||||
}
|
||||
rev.numbered_files = numbered_files;
|
||||
rev.patch_suffix = fmt_patch_suffix;
|
||||
@ -1298,8 +1298,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
|
||||
&& (!cover_letter || rev.nr > 1))
|
||||
free(rev.message_id);
|
||||
else
|
||||
string_list_append(rev.message_id,
|
||||
rev.ref_message_ids);
|
||||
string_list_append(rev.ref_message_ids,
|
||||
rev.message_id);
|
||||
}
|
||||
gen_message_id(&rev, sha1_to_hex(commit->object.sha1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user