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