X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=pack.h;h=eb07b033ae54941d4bd00ee6bc30c7d50fd039b0;hb=af04b1271090801b277938836dcb7a39fc059721;hp=657deaa3f43ebe8627caa93798dd8ae5d956601d;hpb=2b64f88f09ae2169ec85652b46897574e352936d;p=git.git diff --git a/pack.h b/pack.h index 657deaa3f..eb07b033a 100644 --- a/pack.h +++ b/pack.h @@ -1,26 +1,14 @@ #ifndef PACK_H #define PACK_H -/* - * The packed object type is stored in 3 bits. - * The type value 0 is a reserved prefix if ever there is more than 7 - * object types, or any future format extensions. - */ -enum object_type { - OBJ_EXT = 0, - OBJ_COMMIT = 1, - OBJ_TREE = 2, - OBJ_BLOB = 3, - OBJ_TAG = 4, - /* 5/6 for future expansion */ - OBJ_DELTA = 7, -}; +#include "object.h" /* * Packed object header */ #define PACK_SIGNATURE 0x5041434b /* "PACK" */ #define PACK_VERSION 2 +#define pack_version_ok(v) ((v) == htonl(2) || (v) == htonl(3)) struct pack_header { unsigned int hdr_signature; unsigned int hdr_version; @@ -28,5 +16,7 @@ struct pack_header { }; extern int verify_pack(struct packed_git *, int); - +extern int check_reuse_pack_delta(struct packed_git *, unsigned long, + unsigned char *, unsigned long *, + enum object_type *); #endif