]> git.ipfire.org Git - thirdparty/git.git/commit - connect.c
connect: in ref advertisement, shallows are last
authorJonathan Tan <jonathantanmy@google.com>
Tue, 26 Sep 2017 23:56:19 +0000 (16:56 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Sep 2017 01:07:44 +0000 (10:07 +0900)
commit0cd83283dfd2a22b3f95cbee6eaef196e6bde77d
tree29ad92cff6879bb372b459ce6e71cbedb91b75e5
parent7451fcdc0d3cffdb9aa79d2651830b44a8e052d6
connect: in ref advertisement, shallows are last

Currently, get_remote_heads() parses the ref advertisement in one loop,
allowing refs and shallow lines to intersperse, despite this not being
allowed by the specification. Refactor get_remote_heads() to use two
loops instead, enforcing that refs come first, and then shallows.

This also makes it easier to teach get_remote_heads() to interpret other
lines in the ref advertisement, which will be done in a subsequent
patch.

As part of this change, this patch interprets capabilities only on the
first line in the ref advertisement, printing a warning message when
encountering capabilities on other lines.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
connect.c