| 1440 | } |
| 1441 | |
| 1442 | int read_pack_header(int fd, struct pack_header *header) |
| 1443 | { |
| 1444 | if (read_in_full(fd, header, sizeof(*header)) != sizeof(*header)) |
| 1445 | /* "eof before pack header was fully read" */ |
| 1446 | return PH_ERROR_EOF; |
| 1447 | |
| 1448 | if (header->hdr_signature != htonl(PACK_SIGNATURE)) |
| 1449 | /* "protocol error (pack signature mismatch detected)" */ |
| 1450 | return PH_ERROR_PACK_SIGNATURE; |
| 1451 | if (!pack_version_ok(header->hdr_version)) |
| 1452 | /* "protocol error (pack version unsupported)" */ |
| 1453 | return PH_ERROR_PROTOCOL; |
| 1454 | return 0; |
| 1455 | } |
| 1456 | |
| 1457 | int for_each_file_in_obj_subdir(unsigned int subdir_nr, |
| 1458 | struct strbuf *path, |
no test coverage detected