]> git.ipfire.org Git - thirdparty/git.git/blob - send-pack.h
c5ded2d2006f13c80d1fb097173f5a6a89606630
[thirdparty/git.git] / send-pack.h
1 #ifndef SEND_PACK_H
2 #define SEND_PACK_H
3
4 #include "string-list.h"
5
6 struct child_process;
7 struct oid_array;
8 struct ref;
9 struct repository;
10
11 /* Possible values for push_cert field in send_pack_args. */
12 #define SEND_PACK_PUSH_CERT_NEVER 0
13 #define SEND_PACK_PUSH_CERT_IF_ASKED 1
14 #define SEND_PACK_PUSH_CERT_ALWAYS 2
15
16 /* At least one reference has been rejected by the remote side. */
17 #define ERROR_SEND_PACK_BAD_REF_STATUS 1
18
19 struct send_pack_args {
20 const char *url;
21 unsigned verbose:1,
22 quiet:1,
23 porcelain:1,
24 progress:1,
25 send_mirror:1,
26 force_update:1,
27 use_thin_pack:1,
28 use_ofs_delta:1,
29 dry_run:1,
30 /* One of the SEND_PACK_PUSH_CERT_* constants. */
31 push_cert:2,
32 stateless_rpc:1,
33 atomic:1,
34 disable_bitmaps:1;
35 const struct string_list *push_options;
36 };
37
38 struct option;
39 int option_parse_push_signed(const struct option *opt,
40 const char *arg, int unset);
41
42 /*
43 * Compute a packfile and write it to a file descriptor. The `fd` array needs
44 * to contain two file descriptors: `fd[0]` is the file descriptor used as
45 * input for the packet reader, whereas `fd[1]` is the file descriptor the
46 * packfile will be written to.
47 *
48 * Returns 0 on success, non-zero otherwise. Negative return values indicate a
49 * generic error, whereas positive return values indicate specific error
50 * conditions as documented with the `ERROR_SEND_PACK_*` constants.
51 */
52 int send_pack(struct repository *r, struct send_pack_args *args,
53 int fd[], struct child_process *conn,
54 struct ref *remote_refs, struct oid_array *extra_have);
55
56 #endif