aboutsummaryrefslogtreecommitdiff
path: root/remote.h
diff options
context:
space:
mode:
authorToon Claes <toon@iotcl.com>2025-02-06 07:33:33 +0100
committerJunio C Hamano <gitster@pobox.com>2025-02-06 12:23:54 -0800
commit7a52a8c7d855d3ed779059af160248934ac2c6b0 (patch)
treeac459e99c5846ff6e2d77769d9e408de4c9e7190 /remote.h
parent2ca67c6f1433586e61487295bb04cc424992db12 (diff)
downloadgit-7a52a8c7d855d3ed779059af160248934ac2c6b0.tar.xz
clone: introduce struct clone_opts in builtin/clone.c
There is a lot of state stored in global variables in builtin/clone.c. In the long run we'd like to remove many of those. Introduce `struct clone_opts` in this file. This struct will be used to contain all details needed to perform the clone. The struct object can be thrown around to all the functions that need these details. The first field we're adding is `wants_head`. In some scenarios (specifically when both `--single-branch` and `--branch` are given) we are not interested in `HEAD` on the remote. The field `wants_head` in `struct clone_opts` will hold this information. We could have put `option_branch` and `option_single_branch` into that struct instead, but in a following commit we'll be using `wants_head` as well. Signed-off-by: Toon Claes <toon@iotcl.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.h')
-rw-r--r--remote.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/remote.h b/remote.h
index bda10dd5c8..c4acb832a1 100644
--- a/remote.h
+++ b/remote.h
@@ -219,6 +219,11 @@ struct ref *alloc_ref(const char *name);
struct ref *copy_ref(const struct ref *ref);
struct ref *copy_ref_list(const struct ref *ref);
int count_refspec_match(const char *, struct ref *refs, struct ref **matched_ref);
+/*
+ * Put a ref in the tail and prepare tail for adding another one.
+ * *tail is the pointer to the tail of the list of refs.
+ */
+void tail_link_ref(struct ref *ref, struct ref ***tail);
int check_ref_type(const struct ref *ref, int flags);