interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / bundle.h

73 lines · 2339 bytes Raw Blame History
1#ifndef BUNDLE_H
2#define BUNDLE_H
3
4#include "strvec.h"
5#include "string-list.h"
6#include "list-objects-filter-options.h"
7
8struct bundle_header {
9 unsigned version;
10 struct string_list prerequisites;
11 struct string_list references;
12 const struct git_hash_algo *hash_algo;
13 struct list_objects_filter_options filter;
14};
15
16#define BUNDLE_HEADER_INIT \
17{ \
18 .prerequisites = STRING_LIST_INIT_DUP, \
19 .references = STRING_LIST_INIT_DUP, \
20 .filter = LIST_OBJECTS_FILTER_INIT, \
21}
22void bundle_header_init(struct bundle_header *header);
23void bundle_header_release(struct bundle_header *header);
24
25int is_bundle(const char *path, int quiet);
26int read_bundle_header(const char *path, struct bundle_header *header);
27int read_bundle_header_fd(int fd, struct bundle_header *header,
28 const char *report_path);
29int create_bundle(struct repository *r, const char *path,
30 int argc, const char **argv, int version, int progress);
31
32enum verify_bundle_flags {
33 VERIFY_BUNDLE_VERBOSE = (1 << 0),
34 VERIFY_BUNDLE_QUIET = (1 << 1),
35 VERIFY_BUNDLE_FSCK = (1 << 2),
36};
37
38int verify_bundle(struct repository *r, struct bundle_header *header,
39 enum verify_bundle_flags flags);
40
41struct unbundle_opts {
42 enum verify_bundle_flags flags;
43 /*
44 * fsck_msg_types may optionally contain fsck message severity
45 * configuration. If present, this configuration gets directly appended
46 * to a '--fsck-objects' option and therefore must be prefixed with '='.
47 * (E.g. "=missingEmail=ignore,gitmodulesUrl=ignore")
48 */
49 const char *fsck_msg_types;
50};
51
52/**
53 * Unbundle after reading the header with read_bundle_header().
54 *
55 * We'll invoke "git index-pack --stdin --fix-thin" for you on the
56 * provided `bundle_fd` from read_bundle_header().
57 *
58 * Provide "extra_index_pack_args" to pass any extra arguments
59 * (e.g. "-v" for verbose/progress), NULL otherwise. The provided
60 * "extra_index_pack_args" (if any) will be strvec_clear()'d for you.
61 *
62 * Before unbundling, this method will call verify_bundle() with 'flags'
63 * provided in 'opts'.
64 *
65 * Note that the `bundle_fd` will be closed as part of the operation.
66 */
67int unbundle(struct repository *r, struct bundle_header *header,
68 int bundle_fd, struct strvec *extra_index_pack_args,
69 struct unbundle_opts *opts);
70int list_bundle_refs(struct bundle_header *header,
71 int argc, const char **argv);
72
73#endif