clone: do not add alternate references to extra_refs

Alternate references are directly (and now, correctly) handled by fetch-pack, so there is no need to inform fetch-pack about them via the extra_refs back channel. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Michael Haggerty committed Feb 11, 2012 at 07:21 UTC a1287f7540d2a27fcde26b356dc176c5dbb4f4e2
1 file changed -12
builtin/clone.c
-12
@@ -232,9 +232,6 @@ static int add_one_reference(struct string_list_item *item, void *cb_data)
232 {
233 char *ref_git;
234 struct strbuf alternate = STRBUF_INIT;
235 - struct remote *remote;
236 - struct transport *transport;
237 - const struct ref *extra;
235
236 /* Beware: real_path() and mkpath() return static buffer */
237 ref_git = xstrdup(real_path(item->string));
@@ -249,14 +246,6 @@ static int add_one_reference(struct string_list_item *item, void *cb_data)
246 strbuf_addf(&alternate, "%s/objects", ref_git);
247 add_to_alternates_file(alternate.buf);
248 strbuf_release(&alternate);
252 -
253 - remote = remote_get(ref_git);
254 - transport = transport_get(remote, ref_git);
255 - for (extra = transport_get_remote_refs(transport); extra;
256 - extra = extra->next)
257 - add_extra_ref(extra->name, extra->old_sha1, 0);
258 -
259 - transport_disconnect(transport);
249 free(ref_git);
250 return 0;
251 }
@@ -500,7 +489,6 @@ static void update_remote_refs(const struct ref *refs,
489 const char *msg)
490 {
491 if (refs) {
503 - clear_extra_refs();
492 write_remote_refs(mapped_refs);
493 if (option_single_branch)
494 write_followtags(refs, msg);