{"thread":{"id":"12442","subject":"[PATCH v3 2/8] Remove unnecessary delaying of free_refs(ref_map) in builtin-fetch","startedAt":"2008-03-03T02:34:43Z","lastAt":"2008-03-03T02:34:43Z","messageCount":1,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":3,"patchTotal":8},"messages":[{"id":"70727","messageId":"20080303023443.GB9966@spearce.org","threadId":"12442","inReplyTo":null,"subject":"[PATCH v3 2/8] Remove unnecessary delaying of free_refs(ref_map) in builtin-fetch","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-03-03T02:34:43Z","receivedAt":"2008-03-03T02:34:43Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"We can free this ref_map as soon as the fetch is complete.  It is not\nused for the automatic tag following, nor is it used to disconnect the\ntransport.  This avoids some confusion about why we are holding onto\nthese refs while following tags.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n builtin-fetch.c |    7 ++-----\n 1 files changed, 2 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin-fetch.c b/builtin-fetch.c\nindex f8b9542..1348a0e 100644\n--- a/builtin-fetch.c\n+++ b/builtin-fetch.c\n@@ -509,7 +509,7 @@ static struct ref *find_non_local_tags(struct transport *transport)\n static int do_fetch(struct transport *transport,\n \t\t    struct refspec *refs, int ref_count)\n {\n-\tstruct ref *ref_map, *fetch_map;\n+\tstruct ref *ref_map;\n \tstruct ref *rm;\n \tint autotags = (transport->remote->fetch_tags == 1);\n \tif (transport->remote->fetch_tags == 2 && tags != TAGS_UNSET)\n@@ -540,8 +540,7 @@ static int do_fetch(struct transport *transport,\n \t\tfree_refs(ref_map);\n \t\treturn 1;\n \t}\n-\n-\tfetch_map = ref_map;\n+\tfree_refs(ref_map);\n \n \t/* if neither --no-tags nor --tags was specified, do automated tag\n \t * following ... */\n@@ -554,8 +553,6 @@ static int do_fetch(struct transport *transport,\n \t\tfree_refs(ref_map);\n \t}\n \n-\tfree_refs(fetch_map);\n"}]}