X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=http-fetch.c;fp=http-fetch.c;h=ce3df5f35c1fe16dbafec299ade95bb706d86e77;hb=53f313897e37f25e1411a6a7cfa328d642847345;hp=bddbd6b10068edfa7786266feb276a404a9551e2;hpb=66f04f38f42024dceb1679fc4d672de3746cf237;p=git.git diff --git a/http-fetch.c b/http-fetch.c index bddbd6b1..ce3df5f3 100644 --- a/http-fetch.c +++ b/http-fetch.c @@ -773,6 +773,20 @@ static int fetch_pack(struct alt_base *repo, unsigned char *sha1) return 0; } +static void abort_object_request(struct object_request *obj_req) +{ + if (obj_req->local >= 0) { + close(obj_req->local); + obj_req->local = -1; + } + unlink(obj_req->tmpfile); + if (obj_req->slot) { + release_active_slot(obj_req->slot); + obj_req->slot = NULL; + } + release_object_request(obj_req); +} + static int fetch_object(struct alt_base *repo, unsigned char *sha1) { char *hex = sha1_to_hex(sha1); @@ -785,7 +799,7 @@ static int fetch_object(struct alt_base *repo, unsigned char *sha1) return error("Couldn't find request for %s in the queue", hex); if (has_sha1_file(obj_req->sha1)) { - release_object_request(obj_req); + abort_object_request(obj_req); return 0; }