From: Junio C Hamano Date: Thu, 5 Mar 2015 21:12:57 +0000 (-0800) Subject: Merge branch 'mh/deref-symref-over-helper-transport' into maint X-Git-Tag: v2.3.2~23 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/6db0497e1a8913fdcb935fa50cc8971d64b347be?ds=inline;hp=-c Merge branch 'mh/deref-symref-over-helper-transport' into maint "git fetch" over a remote-helper that cannot respond to "list" command could not fetch from a symbolic reference e.g. HEAD. * mh/deref-symref-over-helper-transport: transport-helper: do not request symbolic refs to remote helpers --- 6db0497e1a8913fdcb935fa50cc8971d64b347be diff --combined transport-helper.c index 3652b164c3,27c82f73ac..3b90ebadb9 --- a/transport-helper.c +++ b/transport-helper.c @@@ -5,6 -5,7 +5,6 @@@ #include "commit.h" #include "diff.h" #include "revision.h" -#include "quote.h" #include "remote.h" #include "string-list.h" #include "thread-utils.h" @@@ -355,7 -356,8 +355,8 @@@ static int fetch_with_fetch(struct tran continue; strbuf_addf(&buf, "fetch %s %s\n", - sha1_to_hex(posn->old_sha1), posn->name); + sha1_to_hex(posn->old_sha1), + posn->symref ? posn->symref : posn->name); } strbuf_addch(&buf, '\n'); @@@ -453,7 -455,8 +454,8 @@@ static int fetch_with_import(struct tra if (posn->status & REF_STATUS_UPTODATE) continue; - strbuf_addf(&buf, "import %s\n", posn->name); + strbuf_addf(&buf, "import %s\n", + posn->symref ? posn->symref : posn->name); sendline(data, &buf); strbuf_reset(&buf); } @@@ -486,14 -489,15 +488,15 @@@ * fast-forward or this is a forced update. */ for (i = 0; i < nr_heads; i++) { - char *private; + char *private, *name; posn = to_fetch[i]; if (posn->status & REF_STATUS_UPTODATE) continue; + name = posn->symref ? posn->symref : posn->name; if (data->refspecs) - private = apply_refspecs(data->refspecs, data->refspec_nr, posn->name); + private = apply_refspecs(data->refspecs, data->refspec_nr, name); else - private = xstrdup(posn->name); + private = xstrdup(name); if (private) { read_ref(private, posn->old_sha1); free(private);