Merge branch 'tb/midx-repack-ignore-cruft-packs'
[git/debian.git] / bundle.h
blob68ff39a0a74085a218f16d07619fad0adad1972c
1 #ifndef BUNDLE_H
2 #define BUNDLE_H
4 #include "strvec.h"
5 #include "cache.h"
6 #include "string-list.h"
7 #include "list-objects-filter-options.h"
9 struct bundle_header {
10 unsigned version;
11 struct string_list prerequisites;
12 struct string_list references;
13 const struct git_hash_algo *hash_algo;
14 struct list_objects_filter_options filter;
17 #define BUNDLE_HEADER_INIT \
18 { \
19 .prerequisites = STRING_LIST_INIT_DUP, \
20 .references = STRING_LIST_INIT_DUP, \
21 .filter = LIST_OBJECTS_FILTER_INIT, \
23 void bundle_header_init(struct bundle_header *header);
24 void bundle_header_release(struct bundle_header *header);
26 int is_bundle(const char *path, int quiet);
27 int read_bundle_header(const char *path, struct bundle_header *header);
28 int read_bundle_header_fd(int fd, struct bundle_header *header,
29 const char *report_path);
30 int create_bundle(struct repository *r, const char *path,
31 int argc, const char **argv, struct strvec *pack_options,
32 int version);
33 int verify_bundle(struct repository *r, struct bundle_header *header, int verbose);
35 /**
36 * Unbundle after reading the header with read_bundle_header().
38 * We'll invoke "git index-pack --stdin --fix-thin" for you on the
39 * provided `bundle_fd` from read_bundle_header().
41 * Provide "extra_index_pack_args" to pass any extra arguments
42 * (e.g. "-v" for verbose/progress), NULL otherwise. The provided
43 * "extra_index_pack_args" (if any) will be strvec_clear()'d for you.
45 int unbundle(struct repository *r, struct bundle_header *header,
46 int bundle_fd, struct strvec *extra_index_pack_args);
47 int list_bundle_refs(struct bundle_header *header,
48 int argc, const char **argv);
50 #endif