Ensure tail pointer gets setup correctly when we fetch HEAD only

If we ever decided to append onto the end of this list the tail
pointer must be looking at the right memory cell at the end of
the HEAD ref_map.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff --git a/builtin-fetch.c b/builtin-fetch.c
index 1348a0e..5bce20f 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -157,6 +157,7 @@
 			if (!ref_map)
 				die("Couldn't find remote ref HEAD");
 			ref_map->merge = 1;
+			tail = &ref_map->next;
 		}
 	}
 	ref_remove_duplicates(ref_map);