]> git.ipfire.org Git - thirdparty/git.git/blobdiff - cache.h
refactor duplicated encode_header in pack-objects and fast-import
[thirdparty/git.git] / cache.h
diff --git a/cache.h b/cache.h
index d478eff1f323f25a474cf019e0de2254c5ff0360..2654b608ba8226bcaaae6c2afe9a30fb98fd79de 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -911,6 +911,14 @@ extern void *unpack_entry(struct packed_git *, off_t, enum object_type *, unsign
 extern unsigned long unpack_object_header_buffer(const unsigned char *buf, unsigned long len, enum object_type *type, unsigned long *sizep);
 extern unsigned long get_size_from_delta(struct packed_git *, struct pack_window **, off_t);
 extern const char *packed_object_info_detail(struct packed_git *, off_t, unsigned long *, unsigned long *, unsigned int *, unsigned char *);
+/*
+ * The per-object header is a pretty dense thing, which is
+ *  - first byte: low four bits are "size", then three bits of "type",
+ *    and the high bit is "size continues".
+ *  - each byte afterwards: low seven bits are size continuation,
+ *    with the high bit being "size continues"
+ */
+int encode_in_pack_object_header(enum object_type type, uintmax_t size, unsigned char *hdr);
 
 /* Dumb servers support */
 extern int update_server_info(int);