reset: make sparse-aware (except --mixed)
[git.git] / bundle.h
blob06009fe6b1f00b939350ba88ba7bf8f72565de4c
1 #ifndef BUNDLE_H
2 #define BUNDLE_H
4 #include "strvec.h"
5 #include "cache.h"
6 #include "string-list.h"
8 struct bundle_header {
9 unsigned version;
10 struct string_list prerequisites;
11 struct string_list references;
12 const struct git_hash_algo *hash_algo;
15 #define BUNDLE_HEADER_INIT \
16 { \
17 .prerequisites = STRING_LIST_INIT_DUP, \
18 .references = STRING_LIST_INIT_DUP, \
20 void bundle_header_init(struct bundle_header *header);
21 void bundle_header_release(struct bundle_header *header);
23 int is_bundle(const char *path, int quiet);
24 int read_bundle_header(const char *path, struct bundle_header *header);
25 int create_bundle(struct repository *r, const char *path,
26 int argc, const char **argv, struct strvec *pack_options,
27 int version);
28 int verify_bundle(struct repository *r, struct bundle_header *header, int verbose);
30 /**
31 * Unbundle after reading the header with read_bundle_header().
33 * We'll invoke "git index-pack --stdin --fix-thin" for you on the
34 * provided `bundle_fd` from read_bundle_header().
36 * Provide "extra_index_pack_args" to pass any extra arguments
37 * (e.g. "-v" for verbose/progress), NULL otherwise. The provided
38 * "extra_index_pack_args" (if any) will be strvec_clear()'d for you.
40 int unbundle(struct repository *r, struct bundle_header *header,
41 int bundle_fd, struct strvec *extra_index_pack_args);
42 int list_bundle_refs(struct bundle_header *header,
43 int argc, const char **argv);
45 #endif