upload-pack: send symbolic ref information as capability
commit7171d8c15f919c760d52f814a0aee1b1253385b1
authorJunio C Hamano <gitster@pobox.com>
Tue, 17 Sep 2013 23:17:33 +0000 (17 16:17 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 18 Sep 2013 04:50:26 +0000 (17 21:50 -0700)
tree55e34319af1d9155119cbf6de0ccf2852f08ffb0
parenta4d695de0dbaf41505cb6db44c6bb8290980398e
upload-pack: send symbolic ref information as capability

One long-standing flaw in the pack transfer protocol was that there
was no way to tell the other end which branch "HEAD" points at.
With a capability "symref=HEAD:refs/heads/master", let the sender to
tell the receiver what symbolic ref points at what ref.

This capability can be repeated more than once to represent symbolic
refs other than HEAD, such as "refs/remotes/origin/HEAD").

Add an infrastructure to collect symbolic refs, format them as extra
capabilities and put it on the wire.  For now, just send information
on the "HEAD" and nothing else.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
upload-pack.c