]> Kevux Git Server - rit/commitdiff
http: cleanup function fetch_and_setup_pack_index()
authorLorenzoPegorari <lorenzo.pegorari2002@gmail.com>
Mon, 1 Jun 2026 13:52:01 +0000 (15:52 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Jun 2026 22:57:52 +0000 (07:57 +0900)
Cleanup the function `fetch_and_setup_pack_index()` by removing the
useless call to the function `unlink()`.

This is not necessary anymore since 63aca3f7f1 (dumb-http: store
downloaded pack idx as tempfile, 2024-10-25), when `fetch_pack_index()`
started registering its return value (in this case `tmp_idx`) as a
tempfile to be deleted at process exit.

Signed-off-by: LorenzoPegorari <lorenzo.pegorari2002@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http.c

diff --git a/http.c b/http.c
index ea9b16861bc3d4ef2c5c2a65b9c8b080ec018a84..55dd856a279a23e191c72598abc7e8b4cc426080 100644 (file)
--- a/http.c
+++ b/http.c
@@ -2609,9 +2609,7 @@ static int fetch_and_setup_pack_index(struct packfile_list *packs,
 
        new_pack = parse_pack_index(the_repository, sha1, tmp_idx);
        if (!new_pack) {
-               unlink(tmp_idx);
                free(tmp_idx);
-
                return -1; /* parse_pack_index() already issued error message */
        }