fetch-pack: perform a fetch using v2
[git] / fetch-pack.h
1 #ifndef FETCH_PACK_H
2 #define FETCH_PACK_H
3
4 #include "string-list.h"
5 #include "run-command.h"
6 #include "protocol.h"
7
8 struct oid_array;
9
10 struct fetch_pack_args {
11         const char *uploadpack;
12         int unpacklimit;
13         int depth;
14         const char *deepen_since;
15         const struct string_list *deepen_not;
16         unsigned deepen_relative:1;
17         unsigned quiet:1;
18         unsigned keep_pack:1;
19         unsigned lock_pack:1;
20         unsigned use_thin_pack:1;
21         unsigned fetch_all:1;
22         unsigned stdin_refs:1;
23         unsigned diag_url:1;
24         unsigned verbose:1;
25         unsigned no_progress:1;
26         unsigned include_tag:1;
27         unsigned stateless_rpc:1;
28         unsigned check_self_contained_and_connected:1;
29         unsigned self_contained_and_connected:1;
30         unsigned cloning:1;
31         unsigned update_shallow:1;
32         unsigned deepen:1;
33 };
34
35 /*
36  * sought represents remote references that should be updated from.
37  * On return, the names that were found on the remote will have been
38  * marked as such.
39  */
40 struct ref *fetch_pack(struct fetch_pack_args *args,
41                        int fd[], struct child_process *conn,
42                        const struct ref *ref,
43                        const char *dest,
44                        struct ref **sought,
45                        int nr_sought,
46                        struct oid_array *shallow,
47                        char **pack_lockfile,
48                        enum protocol_version version);
49
50 /*
51  * Print an appropriate error message for each sought ref that wasn't
52  * matched.  Return 0 if all sought refs were matched, otherwise 1.
53  */
54 int report_unmatched_refs(struct ref **sought, int nr_sought);
55
56 #endif