}
fprintf(stderr, "Fetching pack %s\n",
- sha1_to_hex(target->hash));
+ hash_to_hex(target->hash));
fprintf(stderr, " which contains %s\n", oid_to_hex(&request->obj->oid));
preq = new_http_pack_request(target, repo->url);
if (request->headers != NULL)
curl_slist_free_all(request->headers);
- /* URL is reused for MOVE after PUT */
- if (request->state != RUN_PUT) {
+ /* URL is reused for MOVE after PUT and used during FETCH */
+ if (request->state != RUN_PUT && request->state != RUN_FETCH_PACKED) {
FREE_AND_NULL(request->url);
}
return count;
}
-static int update_remote(unsigned char *sha1, struct remote_lock *lock)
+static int update_remote(const struct object_id *oid, struct remote_lock *lock)
{
struct active_request_slot *slot;
struct slot_results results;
dav_headers = get_dav_token_headers(lock, DAV_HEADER_IF);
- strbuf_addf(&out_buffer.buf, "%s\n", sha1_to_hex(sha1));
+ strbuf_addf(&out_buffer.buf, "%s\n", oid_to_hex(oid));
slot = get_active_slot();
slot->results = &results;
run_request_queue();
/* Update the remote branch if all went well */
- if (aborted || !update_remote(ref->new_oid.hash, ref_lock))
+ if (aborted || !update_remote(&ref->new_oid, ref_lock))
rc = 1;
if (!rc)