+ /* Don't use the index if the pack isn't there */
+ url = xmalloc(strlen(repo->base) + 64);
+ sprintf(url, "%s/objects/pack/pack-%s.pack", repo->base, hex);
+ slot = get_active_slot();
+ slot->results = &results;
+ curl_easy_setopt(slot->curl, CURLOPT_URL, url);
+ curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 1);
+ if (start_active_slot(slot)) {
+ run_active_slot(slot);
+ if (results.curl_result != CURLE_OK) {
+ free(url);
+ return error("Unable to verify pack %s is available",
+ hex);
+ }
+ } else {
+ free(url);
+ return error("Unable to start request");
+ }
+
+ if (has_pack_index(sha1)) {
+ free(url);