From: Junio C Hamano Date: Thu, 21 Jul 2022 01:02:15 +0000 (-0700) Subject: builtin/remote.c: use the right kind of STRING_LIST_INIT X-Git-Tag: v2.37.2~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1e11fab59c71d191970233cf8c2f573458ed952c;p=thirdparty%2Fgit.git builtin/remote.c: use the right kind of STRING_LIST_INIT Since 4a4b4cda (builtin-remote: Make "remote -v" display push urls, 2009-06-13), the string_list that was initialized with 0 in its strdup_string member is immediately made to strdup its key strings by flipping the strdup_string member to true. When 183113a5 (string_list: Add STRING_LIST_INIT macro and make use of it., 2010-07-04) has introduced STRING_LIST_INIT macros, it mechanically replaced the initialization to STRING_LIST_INIT_NODUP. Instead, just use the other initialization macro to make it strdup the key from the beginning. Signed-off-by: Junio C Hamano --- diff --git a/builtin/remote.c b/builtin/remote.c index 299c466116..ac3ab4495b 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -1189,10 +1189,9 @@ static int get_one_entry(struct remote *remote, void *priv) static int show_all(void) { - struct string_list list = STRING_LIST_INIT_NODUP; + struct string_list list = STRING_LIST_INIT_DUP; int result; - list.strdup_strings = 1; result = for_each_remote(get_one_entry, &list); if (!result) {