]> git.ipfire.org Git - thirdparty/git.git/blobdiff - http.c
Fix some printf format warnings
[thirdparty/git.git] / http.c
diff --git a/http.c b/http.c
index 14d535747d943c2db3d45d82439f3ee9633ed2d9..23b2a1932c7daebd585827da7effd1c5bbae5e69 100644 (file)
--- a/http.c
+++ b/http.c
@@ -719,7 +719,9 @@ void append_remote_object_url(struct strbuf *buf, const char *url,
                              const char *hex,
                              int only_two_digit_prefix)
 {
-       strbuf_addf(buf, "%s/objects/%.*s/", url, 2, hex);
+       end_url_with_slash(buf, url);
+
+       strbuf_addf(buf, "objects/%.*s/", 2, hex);
        if (!only_two_digit_prefix)
                strbuf_addf(buf, "%s", hex+2);
 }
@@ -864,20 +866,9 @@ static int fetch_pack_index(unsigned char *sha1, const char *base_url)
        int ret = 0;
        char *hex = xstrdup(sha1_to_hex(sha1));
        char *filename;
-       char *url;
+       char *url = NULL;
        struct strbuf buf = STRBUF_INIT;
 
-       /* Don't use the index if the pack isn't there */
-       end_url_with_slash(&buf, base_url);
-       strbuf_addf(&buf, "objects/pack/pack-%s.pack", hex);
-       url = strbuf_detach(&buf, 0);
-
-       if (http_get_strbuf(url, NULL, 0)) {
-               ret = error("Unable to verify pack %s is available",
-                           hex);
-               goto cleanup;
-       }
-
        if (has_pack_index(sha1)) {
                ret = 0;
                goto cleanup;
@@ -1287,5 +1278,10 @@ void release_http_object_request(struct http_object_request *freq)
                free(freq->url);
                freq->url = NULL;
        }
-       freq->slot = NULL;
+       if (freq->slot != NULL) {
+               freq->slot->callback_func = NULL;
+               freq->slot->callback_data = NULL;
+               release_active_slot(freq->slot);
+               freq->slot = NULL;
+       }
 }