Skip to content

Commit 4d3164c

Browse files
jonathantanmygitster
authored andcommitted
http: improve documentation of http_pack_request
struct http_pack_request and the functions that use it will be modified in a subsequent patch. Using it is complicated (to use, call the initialization function, then set some but not all fields in the returned struct), so add some documentation to help future users. Signed-off-by: Jonathan Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b6d3ccd commit 4d3164c

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

http.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,31 @@ extern int http_get_info_packs(const char *base_url,
202202
struct packed_git **packs_head);
203203

204204
struct http_pack_request {
205+
/*
206+
* Initialized by new_http_pack_request().
207+
*/
205208
char *url;
206209
struct packed_git *target;
210+
struct active_request_slot *slot;
211+
212+
/*
213+
* After calling new_http_pack_request(), point lst to the head of the
214+
* pack list that target is in. finish_http_pack_request() will remove
215+
* target from lst and call install_packed_git() on target.
216+
*/
207217
struct packed_git **lst;
218+
219+
/*
220+
* State managed by functions in http.c.
221+
*/
208222
FILE *packfile;
209223
struct strbuf tmpfile;
210-
struct active_request_slot *slot;
211224
};
212225

226+
/*
227+
* target must be an element in a pack list obtained from
228+
* http_get_info_packs().
229+
*/
213230
extern struct http_pack_request *new_http_pack_request(
214231
struct packed_git *target, const char *base_url);
215232
extern int finish_http_pack_request(struct http_pack_request *preq);

0 commit comments

Comments
 (0)