X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-unpack-objects.c;h=d351e02649401364e7384d0e784901e6f3fcb119;hb=60c0f8462fefed22fc8fb9c4e529665ed8204536;hp=74a90c1129d0ff2f772db937d6f9a0ac4e2589a4;hpb=83877f8d92b2050eb668dc3351277e57779a8f05;p=git.git diff --git a/builtin-unpack-objects.c b/builtin-unpack-objects.c index 74a90c112..d351e0264 100644 --- a/builtin-unpack-objects.c +++ b/builtin-unpack-objects.c @@ -8,8 +8,6 @@ #include "tag.h" #include "tree.h" -#include - static int dry_run, quiet, recover, has_errors; static const char unpack_usage[] = "git-unpack-objects [-n] [-q] [-r] < pack-file"; @@ -371,6 +369,21 @@ int cmd_unpack_objects(int argc, const char **argv, const char *prefix) recover = 1; continue; } + if (!strncmp(arg, "--pack_header=", 14)) { + struct pack_header *hdr; + char *c; + + hdr = (struct pack_header *)buffer; + hdr->hdr_signature = htonl(PACK_SIGNATURE); + hdr->hdr_version = htonl(strtoul(arg + 14, &c, 10)); + if (*c != ',') + die("bad %s", arg); + hdr->hdr_entries = htonl(strtoul(c + 1, &c, 10)); + if (*c) + die("bad %s", arg); + len = sizeof(*hdr); + continue; + } usage(unpack_usage); }