]>
Commit | Line | Data |
---|---|---|
96249c04 DB |
1 | #ifndef SEND_PACK_H |
2 | #define SEND_PACK_H | |
3 | ||
f6a4e61f SB |
4 | #include "string-list.h" |
5 | ||
ef3ca954 EN |
6 | struct child_process; |
7 | struct oid_array; | |
8 | struct ref; | |
5ee907bb | 9 | struct repository; |
ef3ca954 | 10 | |
30261094 DB |
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 | ||
3028db4a JX |
16 | /* At least one reference has been rejected by the remote side. */ |
17 | #define ERROR_SEND_PACK_BAD_REF_STATUS 1 | |
18 | ||
96249c04 | 19 | struct send_pack_args { |
9be89160 | 20 | const char *url; |
96249c04 | 21 | unsigned verbose:1, |
12070329 | 22 | quiet:1, |
77555854 | 23 | porcelain:1, |
d7c411b7 | 24 | progress:1, |
28b9d6e5 | 25 | send_mirror:1, |
96249c04 DB |
26 | force_update:1, |
27 | use_thin_pack:1, | |
b74fce16 | 28 | use_ofs_delta:1, |
de1a2fdd | 29 | dry_run:1, |
30261094 DB |
30 | /* One of the SEND_PACK_PUSH_CERT_* constants. */ |
31 | push_cert:2, | |
4ff17f10 | 32 | stateless_rpc:1, |
82f67ee1 KZ |
33 | atomic:1, |
34 | disable_bitmaps:1; | |
f6a4e61f | 35 | const struct string_list *push_options; |
96249c04 DB |
36 | }; |
37 | ||
30261094 DB |
38 | struct option; |
39 | int option_parse_push_signed(const struct option *opt, | |
40 | const char *arg, int unset); | |
41 | ||
3028db4a JX |
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 | */ | |
5ee907bb | 52 | int send_pack(struct repository *r, struct send_pack_args *args, |
64fcef2d | 53 | int fd[], struct child_process *conn, |
910650d2 | 54 | struct ref *remote_refs, struct oid_array *extra_have); |
96249c04 DB |
55 | |
56 | #endif |