aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/index-pack.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/index-pack.c')
-rw-r--r--builtin/index-pack.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 763b01372a..bab42dfc2a 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1801,18 +1801,10 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
nr_threads = 1;
}
} else if (starts_with(arg, "--pack_header=")) {
- struct pack_header *hdr;
- char *c;
-
- hdr = (struct pack_header *)input_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)
+ if (parse_pack_header_option(arg + 14,
+ input_buffer,
+ &input_len) < 0)
die(_("bad %s"), arg);
- input_len = sizeof(*hdr);
} else if (!strcmp(arg, "-v")) {
verbose = 1;
} else if (!strcmp(arg, "--progress-title")) {