- if (!find_pack_entry(sha1, &e, NULL)) {
- error("cannot read sha1_file for %s", sha1_to_hex(sha1));
+ if (!find_pack_entry(sha1, &e, NULL))
- }
- return unpack_entry(e.p, e.offset, type, size);
+ else
+ return unpack_entry(e.p, e.offset, type, size);
- if (find_pack_entry(sha1, &e, NULL))
- return read_packed_sha1(sha1, type, size);
+ buf = read_packed_sha1(sha1, type, size);
+ if (buf)
+ return buf;
map = map_sha1_file(sha1, &mapsize);
if (map) {
buf = unpack_sha1_file(map, mapsize, type, size);
map = map_sha1_file(sha1, &mapsize);
if (map) {
buf = unpack_sha1_file(map, mapsize, type, size);
- if (find_pack_entry(sha1, &e, NULL))
- return read_packed_sha1(sha1, type, size);
- return NULL;
+ return read_packed_sha1(sha1, type, size);
/* need to unpack and recompress it by itself */
unpacked = read_packed_sha1(sha1, type, &len);
/* need to unpack and recompress it by itself */
unpacked = read_packed_sha1(sha1, type, &len);
hdrlen = sprintf(hdr, "%s %lu", type, len) + 1;
hdrlen = sprintf(hdr, "%s %lu", type, len) + 1;