]>
Commit | Line | Data |
---|---|---|
30415d50 JS |
1 | #ifndef BUNDLE_H |
2 | #define BUNDLE_H | |
3 | ||
dbbcd44f | 4 | #include "strvec.h" |
10b635b7 | 5 | #include "string-list.h" |
105c6f14 | 6 | #include "list-objects-filter-options.h" |
30415d50 JS |
7 | |
8 | struct bundle_header { | |
c5aecfc8 | 9 | unsigned version; |
10b635b7 ÆAB |
10 | struct string_list prerequisites; |
11 | struct string_list references; | |
6161ce7b | 12 | const struct git_hash_algo *hash_algo; |
105c6f14 | 13 | struct list_objects_filter_options filter; |
30415d50 JS |
14 | }; |
15 | ||
10b635b7 ÆAB |
16 | #define BUNDLE_HEADER_INIT \ |
17 | { \ | |
18 | .prerequisites = STRING_LIST_INIT_DUP, \ | |
19 | .references = STRING_LIST_INIT_DUP, \ | |
2a01bded | 20 | .filter = LIST_OBJECTS_FILTER_INIT, \ |
10b635b7 ÆAB |
21 | } |
22 | void bundle_header_init(struct bundle_header *header); | |
23 | void bundle_header_release(struct bundle_header *header); | |
24 | ||
2727b71f | 25 | int is_bundle(const char *path, int quiet); |
30415d50 | 26 | int read_bundle_header(const char *path, struct bundle_header *header); |
89c6e450 ÆAB |
27 | int read_bundle_header_fd(int fd, struct bundle_header *header, |
28 | const char *report_path); | |
fcb133e9 | 29 | int create_bundle(struct repository *r, const char *path, |
e0ad9574 | 30 | int argc, const char **argv, struct strvec *pack_options, |
c5aecfc8 | 31 | int version); |
89bd7fed DS |
32 | |
33 | enum verify_bundle_flags { | |
34 | VERIFY_BUNDLE_VERBOSE = (1 << 0), | |
70334fc3 | 35 | VERIFY_BUNDLE_QUIET = (1 << 1), |
89bd7fed DS |
36 | }; |
37 | ||
38 | int verify_bundle(struct repository *r, struct bundle_header *header, | |
39 | enum verify_bundle_flags flags); | |
08342573 ÆAB |
40 | |
41 | /** | |
42 | * Unbundle after reading the header with read_bundle_header(). | |
43 | * | |
44 | * We'll invoke "git index-pack --stdin --fix-thin" for you on the | |
45 | * provided `bundle_fd` from read_bundle_header(). | |
7366096d ÆAB |
46 | * |
47 | * Provide "extra_index_pack_args" to pass any extra arguments | |
48 | * (e.g. "-v" for verbose/progress), NULL otherwise. The provided | |
49 | * "extra_index_pack_args" (if any) will be strvec_clear()'d for you. | |
89bd7fed DS |
50 | * |
51 | * Before unbundling, this method will call verify_bundle() with the | |
52 | * given 'flags'. | |
08342573 | 53 | */ |
74ae4b63 | 54 | int unbundle(struct repository *r, struct bundle_header *header, |
89bd7fed DS |
55 | int bundle_fd, struct strvec *extra_index_pack_args, |
56 | enum verify_bundle_flags flags); | |
30415d50 JS |
57 | int list_bundle_refs(struct bundle_header *header, |
58 | int argc, const char **argv); | |
59 | ||
60 | #endif |