diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-02-17 10:15:17 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-02-17 10:15:18 -0800 |
commit | a6c68158e574cec416eb60d10f3aabeab0484d56 (patch) | |
tree | 6fac09cd4491d5f42e6ea9185943718fe5f66fe6 /transport-helper.c | |
parent | Post 2.3 cycle (batch #1) (diff) | |
parent | transport-helper: do not request symbolic refs to remote helpers (diff) | |
download | tgif-a6c68158e574cec416eb60d10f3aabeab0484d56.tar.xz |
Merge branch 'mh/deref-symref-over-helper-transport'
"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
Diffstat (limited to 'transport-helper.c')
-rw-r--r-- | transport-helper.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/transport-helper.c b/transport-helper.c index 0224687a23..27c82f73ac 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -356,7 +356,8 @@ static int fetch_with_fetch(struct transport *transport, 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'); @@ -454,7 +455,8 @@ static int fetch_with_import(struct transport *transport, 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); } @@ -487,14 +489,15 @@ static int fetch_with_import(struct transport *transport, * 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); |