submodule: change string_list changed_submodule_paths
Eliminate a call to 'xstrdup()' by changing the string_list 'changed_submodule_paths' to duplicated strings added to it. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Brandon Williams committed
Apr 28, 2017 at 16:54 UTC
a6bb78c3b19697133a01122c13993986b66ef28b
1 file changed
+2
-2
submodule.c
+2
-2
@@ -20,7 +20,7 @@
20
static int config_fetch_recurse_submodules = RECURSE_SUBMODULES_ON_DEMAND;
21
static int config_update_recurse_submodules = RECURSE_SUBMODULES_DEFAULT;
22
static int parallel_jobs = 1;
23
-static struct string_list changed_submodule_paths = STRING_LIST_INIT_NODUP;
23
+static struct string_list changed_submodule_paths = STRING_LIST_INIT_DUP;
24
static int initialized_fetch_ref_tips;
25
static struct oid_array ref_tips_before_fetch;
26
static struct oid_array ref_tips_after_fetch;
@@ -939,7 +939,7 @@ static void submodule_collect_changed_cb(struct diff_queue_struct *q,
939
struct string_list_item *path;
940
path = unsorted_string_list_lookup(&changed_submodule_paths, p->two->path);
941
if (!path && !is_submodule_commit_present(p->two->path, p->two->oid.hash))
942
- string_list_append(&changed_submodule_paths, xstrdup(p->two->path));
942
+ string_list_append(&changed_submodule_paths, p->two->path);
943
} else {
944
/* Submodule is new or was moved here */
945
/* NEEDSWORK: When the .git directories of submodules