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)
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>
No differences found