2 * Copyright (C) 2009-2012 the libgit2 contributors
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
8 #ifndef INCLUDE_pack_objects_h__
9 #define INCLUDE_pack_objects_h__
19 #define GIT_PACK_WINDOW 10 /* number of objects to possibly delta against */
20 #define GIT_PACK_DEPTH 50 /* max delta depth */
21 #define GIT_PACK_DELTA_CACHE_SIZE (256 * 1024 * 1024)
22 #define GIT_PACK_DELTA_CACHE_LIMIT 1000
23 #define GIT_PACK_BIG_FILE_THRESHOLD (512 * 1024 * 1024)
25 typedef struct git_pobject
{
32 unsigned int hash
; /* name hint hash */
34 struct git_pobject
*delta
; /* delta base object */
35 struct git_pobject
*delta_child
; /* deltified objects who bases me */
36 struct git_pobject
*delta_sibling
; /* other deltified objects
37 * who uses the same base as
41 unsigned long delta_size
;
42 unsigned long z_delta_size
;
51 struct git_packbuilder
{
52 git_repository
*repo
; /* associated repository */
53 git_odb
*odb
; /* associated object database */
62 git_pobject
*object_list
;
64 git_oidmap
*object_ix
;
66 git_oid pack_oid
; /* hash of written pack */
69 unsigned long delta_cache_size
;
70 unsigned long max_delta_cache_size
;
71 unsigned long cache_max_small_delta_size
;
72 unsigned long big_file_threshold
;
73 unsigned long window_memory_limit
;
75 int nr_threads
; /* nr of threads to use */
81 int git_packbuilder_send(git_packbuilder
*pb
, git_transport
*t
);
82 int git_packbuilder_write_buf(git_buf
*buf
, git_packbuilder
*pb
);