summaryrefslogtreecommitdiff
path: root/upload-pack.c
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2020-06-04 17:54:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-06-04 17:58:25 (GMT)
commita84972882141c68de40660743e3fddf4394886fe (patch)
tree50b9967a54ec5aded82698af5b7595e67508e0ee /upload-pack.c
parentb5a2068cb1f879b8bff2bfbf99304091d03ce3af (diff)
downloadgit-a84972882141c68de40660743e3fddf4394886fe.zip
git-a84972882141c68de40660743e3fddf4394886fe.tar.gz
git-a84972882141c68de40660743e3fddf4394886fe.tar.bz2
upload-pack: annotate upload_pack_data fields
As we cleanup 'upload-pack.c' by using 'struct upload_pack_data' more thoroughly, let's annotate fields from this struct to let people know which ones are used only for protocol v0 and which ones only for protocol v2. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'upload-pack.c')
-rw-r--r--upload-pack.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/upload-pack.c b/upload-pack.c
index 2fa6458..3963a38 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -70,12 +70,16 @@ static int allow_ref_in_want;
static int allow_sideband_all;
+/*
+ * Please annotate, and if possible group together, fields used only
+ * for protocol v0 or only for protocol v2.
+ */
struct upload_pack_data {
- struct string_list symref;
- struct string_list wanted_refs;
+ struct string_list symref; /* v0 only */
struct object_array want_obj;
struct object_array have_obj;
- struct oid_array haves;
+ struct oid_array haves; /* v2 only */
+ struct string_list wanted_refs; /* v2 only */
struct object_array shallows;
struct string_list deepen_not;
@@ -88,13 +92,14 @@ struct upload_pack_data {
struct packet_writer writer;
- unsigned stateless_rpc : 1;
+ unsigned stateless_rpc : 1; /* v0 only */
unsigned use_thin_pack : 1;
unsigned use_ofs_delta : 1;
unsigned no_progress : 1;
unsigned use_include_tag : 1;
- unsigned done : 1;
+
+ unsigned done : 1; /* v2 only */
};
static void upload_pack_data_init(struct upload_pack_data *data)