From: Jonathan Tan Date: Tue, 26 Sep 2017 23:56:19 +0000 (-0700) Subject: connect: in ref advertisement, shallows are last X-Git-Tag: v2.16.0-rc0~69^2~10 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/0cd83283dfd2a22b3f95cbee6eaef196e6bde77d?hp=0cd83283dfd2a22b3f95cbee6eaef196e6bde77d 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 Signed-off-by: Brandon Williams Signed-off-by: Junio C Hamano ---