@matheusbsbs / matheus-bagliano / commits / a849728821
Fork 0

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>

Christian Couder committed Jun 4, 2020 at 19:54 UTC a84972882141c68de40660743e3fddf4394886fe
1 file changed +10 -5
upload-pack.c
+10 -5
@@ -70,12 +70,16 @@ static int allow_ref_in_want;
70
71 static int allow_sideband_all;
72
73 +/*
74 + * Please annotate, and if possible group together, fields used only
75 + * for protocol v0 or only for protocol v2.
76 + */
77 struct upload_pack_data {
74 - struct string_list symref;
75 - struct string_list wanted_refs;
78 + struct string_list symref; /* v0 only */
79 struct object_array want_obj;
80 struct object_array have_obj;
78 - struct oid_array haves;
81 + struct oid_array haves; /* v2 only */
82 + struct string_list wanted_refs; /* v2 only */
83
84 struct object_array shallows;
85 struct string_list deepen_not;
@@ -88,13 +92,14 @@ struct upload_pack_data {
92
93 struct packet_writer writer;
94
91 - unsigned stateless_rpc : 1;
95 + unsigned stateless_rpc : 1; /* v0 only */
96
97 unsigned use_thin_pack : 1;
98 unsigned use_ofs_delta : 1;
99 unsigned no_progress : 1;
100 unsigned use_include_tag : 1;
97 - unsigned done : 1;
101 +
102 + unsigned done : 1; /* v2 only */
103 };
104
105 static void upload_pack_data_init(struct upload_pack_data *data)