
There are no other API docs in bundle.h, but this is at least a start. We'll add a parameter to this function in a subsequent commit, but let's start by documenting it. The "/**" comment (as opposed to "/*") signifies the start of API documentation. See [1] andbdfdaa4978
(strbuf.h: integrate api-strbuf.txt documentation, 2015-01-16) and6afbbdda33
(strbuf.h: unify documentation comments beginnings, 2015-01-16) for a discussion of that convention. 1. https://lore.kernel.org/git/874kbeecfu.fsf@evledraar.gmail.com/ Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
43 lines
1.2 KiB
C
43 lines
1.2 KiB
C
#ifndef BUNDLE_H
|
|
#define BUNDLE_H
|
|
|
|
#include "strvec.h"
|
|
#include "cache.h"
|
|
#include "string-list.h"
|
|
|
|
struct bundle_header {
|
|
unsigned version;
|
|
struct string_list prerequisites;
|
|
struct string_list references;
|
|
const struct git_hash_algo *hash_algo;
|
|
};
|
|
|
|
#define BUNDLE_HEADER_INIT \
|
|
{ \
|
|
.prerequisites = STRING_LIST_INIT_DUP, \
|
|
.references = STRING_LIST_INIT_DUP, \
|
|
}
|
|
void bundle_header_init(struct bundle_header *header);
|
|
void bundle_header_release(struct bundle_header *header);
|
|
|
|
int is_bundle(const char *path, int quiet);
|
|
int read_bundle_header(const char *path, struct bundle_header *header);
|
|
int create_bundle(struct repository *r, const char *path,
|
|
int argc, const char **argv, struct strvec *pack_options,
|
|
int version);
|
|
int verify_bundle(struct repository *r, struct bundle_header *header, int verbose);
|
|
#define BUNDLE_VERBOSE 1
|
|
|
|
/**
|
|
* Unbundle after reading the header with read_bundle_header().
|
|
*
|
|
* We'll invoke "git index-pack --stdin --fix-thin" for you on the
|
|
* provided `bundle_fd` from read_bundle_header().
|
|
*/
|
|
int unbundle(struct repository *r, struct bundle_header *header,
|
|
int bundle_fd, int flags);
|
|
int list_bundle_refs(struct bundle_header *header,
|
|
int argc, const char **argv);
|
|
|
|
#endif
|