From 4f37d45706514a4b3d0259d26f719678a0cf3521 Mon Sep 17 00:00:00 2001 From: Jonathan Tan Date: Fri, 5 Feb 2021 12:48:49 -0800 Subject: clone: respect remote unborn HEAD Teach Git to use the "unborn" feature introduced in a previous patch as follows: Git will always send the "unborn" argument if it is supported by the server. During "git clone", if cloning an empty repository, Git will use the new information to determine the local branch to create. In all other cases, Git will ignore it. Signed-off-by: Jonathan Tan Signed-off-by: Junio C Hamano --- transport.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'transport.h') diff --git a/transport.h b/transport.h index 1f5b60e4d3..24e15799e7 100644 --- a/transport.h +++ b/transport.h @@ -243,6 +243,14 @@ struct transport_ls_refs_options { * provided ref_prefixes. */ struct strvec ref_prefixes; + + /* + * If unborn_head_target is not NULL, and the remote reports HEAD as + * pointing to an unborn branch, transport_get_remote_refs() stores the + * unborn branch in unborn_head_target. It should be freed by the + * caller. + */ + char *unborn_head_target; }; #define TRANSPORT_LS_REFS_OPTIONS_INIT { STRVEC_INIT } -- cgit v1.2.3