summaryrefslogtreecommitdiffstats
path: root/transport.h
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2021-02-05 21:48:49 +0100
committerJunio C Hamano <gitster@pobox.com>2021-02-05 22:49:55 +0100
commit4f37d45706514a4b3d0259d26f719678a0cf3521 (patch)
tree2b38899f23f3e5e88b72fba0f093e8fb76255089 /transport.h
parentconnect, transport: encapsulate arg in struct (diff)
downloadgit-4f37d45706514a4b3d0259d26f719678a0cf3521.tar.xz
git-4f37d45706514a4b3d0259d26f719678a0cf3521.zip
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 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 }