From 2721ce21e439ee0726dc69073acd7e0d2b2407b3 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 13 Jun 2016 06:04:20 -0400 Subject: use string_list initializer consistently There are two types of string_lists: those that own the string memory, and those that don't. You can tell the difference by the strdup_strings flag, and one should use either STRING_LIST_INIT_DUP, or STRING_LIST_INIT_NODUP as an initializer. Historically, the normal all-zeros initialization has corresponded to the NODUP case. Many sites use no initializer at all, and that works as a shorthand for that case. But for a reader of the code, it can be hard to remember which is which. Let's be more explicit and actually have each site declare which type it means to use. This is a fairly mechanical conversion; I assumed each site was correct as-is, and just switched them all to NODUP. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- submodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'submodule.c') diff --git a/submodule.c b/submodule.c index 4532b11d66..abc2ac2a10 100644 --- a/submodule.c +++ b/submodule.c @@ -17,7 +17,7 @@ static int config_fetch_recurse_submodules = RECURSE_SUBMODULES_ON_DEMAND; static int parallel_jobs = 1; -static struct string_list changed_submodule_paths; +static struct string_list changed_submodule_paths = STRING_LIST_INIT_NODUP; static int initialized_fetch_ref_tips; static struct sha1_array ref_tips_before_fetch; static struct sha1_array ref_tips_after_fetch; -- cgit v1.2.3