diff options
Diffstat (limited to 'packfile.c')
| -rw-r--r-- | packfile.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/packfile.c b/packfile.c index cc7ab6403a..d91016f1c7 100644 --- a/packfile.c +++ b/packfile.c @@ -19,11 +19,12 @@ #include "tree-walk.h" #include "tree.h" #include "object-file.h" -#include "object-store-ll.h" +#include "object-store.h" #include "midx.h" #include "commit-graph.h" #include "pack-revindex.h" #include "promisor-remote.h" +#include "pack-mtimes.h" char *odb_pack_name(struct repository *r, struct strbuf *buf, const unsigned char *hash, const char *ext) @@ -2107,7 +2108,7 @@ static void maybe_invalidate_kept_pack_cache(struct repository *r, r->objects->kept_pack_cache.flags = 0; } -static struct packed_git **kept_pack_cache(struct repository *r, unsigned flags) +struct packed_git **kept_pack_cache(struct repository *r, unsigned flags) { maybe_invalidate_kept_pack_cache(r, flags); @@ -2315,3 +2316,23 @@ int is_promisor_object(struct repository *r, const struct object_id *oid) } return oidset_contains(&promisor_objects, oid); } + +int parse_pack_header_option(const char *in, unsigned char *out, unsigned int *len) +{ + unsigned char *hdr; + char *c; + + hdr = out; + put_be32(hdr, PACK_SIGNATURE); + hdr += 4; + put_be32(hdr, strtoul(in, &c, 10)); + hdr += 4; + if (*c != ',') + return -1; + put_be32(hdr, strtoul(c + 1, &c, 10)); + hdr += 4; + if (*c) + return -1; + *len = hdr - out; + return 0; +} |
