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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tay Ray Chuan <rctay89@xxxxxxxxx> 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]) {
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]