get_packed_ref_cache: reload packed-refs file when it changes
[gitweb.git] / sha1_file.c
index 64228a26d0be873040ebde37e95e62d20f5ba957..5c08701ae85d7bc5a4465ed138fd80b3f3480052 100644 (file)
@@ -2128,7 +2128,6 @@ void *unpack_entry(struct packed_git *p, off_t obj_offset,
                        error("failed to unpack compressed delta "
                              "at offset %"PRIuMAX" from %s",
                              (uintmax_t)curpos, p->pack_name);
-                       free(base);
                        data = NULL;
                        continue;
                }
@@ -2139,7 +2138,7 @@ void *unpack_entry(struct packed_git *p, off_t obj_offset,
                if (!data)
                        die("failed to apply delta");
 
-               free (delta_data);
+               free(delta_data);
        }
 
        *final_type = type;
@@ -2349,7 +2348,7 @@ static int sha1_loose_object_info(const unsigned char *sha1, unsigned long *size
 
        map = map_sha1_file(sha1, &mapsize);
        if (!map)
-               return error("unable to find %s", sha1_to_hex(sha1));
+               return -1;
        if (unpack_sha1_header(&stream, map, mapsize, hdr, sizeof(hdr)) < 0)
                status = error("unable to unpack %s header",
                               sha1_to_hex(sha1));