X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=unpack-objects.c;h=815a1b382b1f92686efd00bee5794a8480d7f7b7;hb=0c8b106b020421c346532351af36028bfdda4c37;hp=5c5cb12f6fa2a9a8fe061c2e75380c8b9e7ebaf1;hpb=1c15afb9343bca82e687d008ec983a9110ac9c40;p=git.git diff --git a/unpack-objects.c b/unpack-objects.c index 5c5cb12f..815a1b38 100644 --- a/unpack-objects.c +++ b/unpack-objects.c @@ -246,13 +246,12 @@ static void unpack_all(void) { int i; struct pack_header *hdr = fill(sizeof(struct pack_header)); - unsigned version = ntohl(hdr->hdr_version); unsigned nr_objects = ntohl(hdr->hdr_entries); if (ntohl(hdr->hdr_signature) != PACK_SIGNATURE) die("bad pack file"); - if (version != PACK_VERSION) - die("unable to handle pack file version %d", version); + if (!pack_version_ok(hdr->hdr_version)) + die("unknown pack file version %d", ntohl(hdr->hdr_version)); fprintf(stderr, "Unpacking %d objects\n", nr_objects); use(sizeof(struct pack_header)); @@ -269,6 +268,8 @@ int main(int argc, char **argv) setup_git_directory(); + quiet = !isatty(2); + for (i = 1 ; i < argc; i++) { const char *arg = argv[i];