Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2021-02-05 23:48:49 +0300
committerJunio C Hamano <gitster@pobox.com>2021-02-06 00:49:55 +0300
commit4f37d45706514a4b3d0259d26f719678a0cf3521 (patch)
tree2b38899f23f3e5e88b72fba0f093e8fb76255089 /transport.h
parent39835409d10de2402c4b3e10dba20286989627d4 (diff)
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 }