]>
Commit | Line | Data |
---|---|---|
2d4177c0 DB |
1 | #ifndef FETCH_PACK_H |
2 | #define FETCH_PACK_H | |
3 | ||
8bee93dd | 4 | #include "string-list.h" |
47a59185 | 5 | #include "run-command.h" |
685fbd32 | 6 | #include "protocol.h" |
640d8b72 | 7 | #include "list-objects-filter-options.h" |
9c1e657a | 8 | #include "oidset.h" |
8bee93dd | 9 | |
910650d2 | 10 | struct oid_array; |
beea4152 | 11 | |
9cba13ca | 12 | struct fetch_pack_args { |
2d4177c0 | 13 | const char *uploadpack; |
2d4177c0 | 14 | int unpacklimit; |
2d4177c0 | 15 | int depth; |
508ea882 | 16 | const char *deepen_since; |
a45a2600 | 17 | const struct string_list *deepen_not; |
640d8b72 | 18 | struct list_objects_filter_options filter_options; |
5e3548ef | 19 | const struct string_list *server_options; |
3390e42a JT |
20 | |
21 | /* | |
22 | * If not NULL, during packfile negotiation, fetch-pack will send "have" | |
23 | * lines only with these tips and their ancestors. | |
24 | */ | |
25 | const struct oid_array *negotiation_tips; | |
26 | ||
cccf74e2 | 27 | unsigned deepen_relative:1; |
f6486f07 NTND |
28 | unsigned quiet:1; |
29 | unsigned keep_pack:1; | |
30 | unsigned lock_pack:1; | |
31 | unsigned use_thin_pack:1; | |
32 | unsigned fetch_all:1; | |
33 | unsigned stdin_refs:1; | |
92251b1b | 34 | unsigned diag_url:1; |
f6486f07 NTND |
35 | unsigned verbose:1; |
36 | unsigned no_progress:1; | |
37 | unsigned include_tag:1; | |
38 | unsigned stateless_rpc:1; | |
39 | unsigned check_self_contained_and_connected:1; | |
40 | unsigned self_contained_and_connected:1; | |
beea4152 | 41 | unsigned cloning:1; |
48d25cae | 42 | unsigned update_shallow:1; |
4fe788b1 | 43 | unsigned reject_shallow_remote:1; |
79891cb9 | 44 | unsigned deepen:1; |
42d418df JT |
45 | |
46 | /* | |
47 | * Indicate that the remote of this request is a promisor remote. The | |
48 | * pack received does not need all referred-to objects to be present in | |
49 | * the local object store, and fetch-pack will store the pack received | |
50 | * together with a ".promisor" file indicating that the aforementioned | |
51 | * pack is a promisor pack. | |
52 | */ | |
88e2f9ed JT |
53 | unsigned from_promisor:1; |
54 | ||
cf1e7c07 JT |
55 | /* |
56 | * Because fetch_pack() overwrites the shallow file upon a | |
57 | * successful deepening non-clone fetch, if this struct | |
58 | * specifies such a fetch, fetch_pack() needs to perform a | |
59 | * connectivity check before deciding if a fetch is successful | |
60 | * (and overwriting the shallow file). fetch_pack() sets this | |
61 | * field to 1 if such a connectivity check was performed. | |
62 | * | |
63 | * This is different from check_self_contained_and_connected | |
64 | * in that the former allows existing objects in the | |
65 | * repository to satisfy connectivity needs, whereas the | |
66 | * latter doesn't. | |
67 | */ | |
68 | unsigned connectivity_checked:1; | |
2d4177c0 DB |
69 | }; |
70 | ||
4ba15999 | 71 | /* |
f2db854d JH |
72 | * sought represents remote references that should be updated from. |
73 | * On return, the names that were found on the remote will have been | |
74 | * marked as such. | |
4ba15999 | 75 | */ |
fa740529 | 76 | struct ref *fetch_pack(struct fetch_pack_args *args, |
0f804b0b | 77 | int fd[], |
63c69453 | 78 | const struct ref *ref, |
f2db854d JH |
79 | struct ref **sought, |
80 | int nr_sought, | |
910650d2 | 81 | struct oid_array *shallow, |
9da69a65 | 82 | struct string_list *pack_lockfiles, |
685fbd32 | 83 | enum protocol_version version); |
2d4177c0 | 84 | |
9c1e657a JT |
85 | /* |
86 | * Execute the --negotiate-only mode of "git fetch", adding all known common | |
87 | * commits to acked_commits. | |
88 | * | |
89 | * In the capability advertisement that has happened prior to invoking this | |
90 | * function, the "wait-for-done" capability must be present. | |
91 | */ | |
92 | void negotiate_using_fetch(const struct oid_array *negotiation_tips, | |
93 | const struct string_list *server_options, | |
94 | int stateless_rpc, | |
95 | int fd[], | |
96 | struct oidset *acked_commits); | |
97 | ||
e860d96b MM |
98 | /* |
99 | * Print an appropriate error message for each sought ref that wasn't | |
100 | * matched. Return 0 if all sought refs were matched, otherwise 1. | |
101 | */ | |
102 | int report_unmatched_refs(struct ref **sought, int nr_sought); | |
103 | ||
2d4177c0 | 104 | #endif |