git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 15/18] http*: add http_get_info_packs

From
Junio C Hamano <gitster@pobox.com>
Date
May 24, 2009, 20:43 UTC
Message-ID
<7veiuetenn.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20090524222003.7da46ff8.rctay89@gmail.com>
Tay Ray Chuan <rctay89@gmail.com> writes:
> fetch_index has been moved to http.c, and is not meant to be used
> outside of http.c. It invokes end_url_with_slash with base_url;
> apart from that change, the code is identical.
Move fetch_index() to http.c; this is not meant to be ...
> setup_index has been moved and renamed to fetch_http_pack_index.

Move setup_index() to http.c, and rename it to fetch_http_pack_index(), as it now is a library function and there are many other kinds of "index" in git.

It makes me wonder if fetch_index(), even though it is static to http.c, should be renamed somehow to reduce confusion between it and fetch_http_pack_index().

You have decl-after-statement and a handful of variable that are no longer used. Please squash this in when rerolling.

 http-push.c   |    2 --
 http-walker.c |    1 -
 http.c        |   10 +++-------
 3 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/http-push.c b/http-push.c
index b96d7db..74bb48e 100644
--- a/http-push.c
+++ b/http-push.c
@@ -952,8 +952,6 @@ static int add_send_request(struct object *obj, struct remote_lock *lock)
 
 static int fetch_indices(void)
 {
-	struct slot_results results;
-
 	if (push_verbosely)
 		fprintf(stderr, "Getting pack list\n");
 
diff --git a/http-walker.c b/http-walker.c
index 2aed391..c550fd9 100644
--- a/http-walker.c
+++ b/http-walker.c
@@ -567,7 +567,6 @@ static void fetch_alternates(struct walker *walker, const char *base)
 static int fetch_indices(struct walker *walker, struct alt_base *repo)
 {
 	int ret = 0;
-	struct slot_results results;
 
 	if (repo->got_indices)
 		return 0;
diff --git a/http.c b/http.c
index ea46075..c74fa26 100644
--- a/http.c
+++ b/http.c
@@ -914,10 +914,10 @@ int fetch_http_pack_index(struct packed_git **packs_head, unsigned char *sha1,
 
 int http_get_info_packs(const char *base_url, struct packed_git **packs_head)
 {
-	int ret = 0;
-	char *url;
+	int ret = 0, i = 0;
+	char *url, *data;
 	struct strbuf buf = STRBUF_INIT;
-	struct http_info_packs_request *req;
+	unsigned char sha1[20];
 
 	end_url_with_slash(&buf, base_url);
 	strbuf_addstr(&buf, "objects/info/packs");
@@ -927,10 +927,6 @@ int http_get_info_packs(const char *base_url, struct packed_git **packs_head)
 	if (ret != HTTP_OK)
 		goto cleanup;
 
-	char *data;
-	int i = 0;
-	unsigned char sha1[20];
-
 	data = buf.buf;
 	while (i < buf.len) {
 		switch (data[i]) {
Previous: Tay Ray ChuanNext: Tay Ray Chuan
Message 2 of 3 in “http*: add http_get_info_packs”
  1. 15/18 http*: add http_get_info_packsTay Ray Chuan, May 24, 2009
  2. Junio C HamanoMay 24, 2009
  3. Tay Ray ChuanMay 29, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.