summaryrefslogtreecommitdiff
path: root/transport.h
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2021-02-05 20:48:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-02-05 21:49:55 (GMT)
commit4f37d45706514a4b3d0259d26f719678a0cf3521 (patch)
tree2b38899f23f3e5e88b72fba0f093e8fb76255089 /transport.h
parent39835409d10de2402c4b3e10dba20286989627d4 (diff)
downloadgit-4f37d45706514a4b3d0259d26f719678a0cf3521.zip
git-4f37d45706514a4b3d0259d26f719678a0cf3521.tar.gz
git-4f37d45706514a4b3d0259d26f719678a0cf3521.tar.bz2
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 <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport.h')
-rw-r--r--transport.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/transport.h b/transport.h
index 1f5b60e..24e1579 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 }