]> git.ipfire.org Git - thirdparty/git.git/blame - fetch-pack.h
Merge branch 'jt/fetch-pack-loosen-validation-with-packfile-uri'
[thirdparty/git.git] / fetch-pack.h
CommitLineData
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"
8bee93dd 8
910650d2 9struct oid_array;
beea4152 10
9cba13ca 11struct fetch_pack_args {
2d4177c0 12 const char *uploadpack;
2d4177c0 13 int unpacklimit;
2d4177c0 14 int depth;
508ea882 15 const char *deepen_since;
a45a2600 16 const struct string_list *deepen_not;
640d8b72 17 struct list_objects_filter_options filter_options;
5e3548ef 18 const struct string_list *server_options;
3390e42a
JT
19
20 /*
21 * If not NULL, during packfile negotiation, fetch-pack will send "have"
22 * lines only with these tips and their ancestors.
23 */
24 const struct oid_array *negotiation_tips;
25
cccf74e2 26 unsigned deepen_relative:1;
f6486f07
NTND
27 unsigned quiet:1;
28 unsigned keep_pack:1;
29 unsigned lock_pack:1;
30 unsigned use_thin_pack:1;
31 unsigned fetch_all:1;
32 unsigned stdin_refs:1;
92251b1b 33 unsigned diag_url:1;
f6486f07
NTND
34 unsigned verbose:1;
35 unsigned no_progress:1;
36 unsigned include_tag:1;
37 unsigned stateless_rpc:1;
38 unsigned check_self_contained_and_connected:1;
39 unsigned self_contained_and_connected:1;
beea4152 40 unsigned cloning:1;
48d25cae 41 unsigned update_shallow:1;
79891cb9 42 unsigned deepen:1;
42d418df
JT
43
44 /*
45 * Indicate that the remote of this request is a promisor remote. The
46 * pack received does not need all referred-to objects to be present in
47 * the local object store, and fetch-pack will store the pack received
48 * together with a ".promisor" file indicating that the aforementioned
49 * pack is a promisor pack.
50 */
88e2f9ed
JT
51 unsigned from_promisor:1;
52
53 /*
4c7f9567
JT
54 * Attempt to fetch only the wanted objects, and not any objects
55 * referred to by them. Due to protocol limitations, extraneous
56 * objects may still be included. (When fetching non-blob
57 * objects, only blobs are excluded; when fetching a blob, the
58 * blob itself will still be sent. The client does not need to
59 * know whether a wanted object is a blob or not.)
60 *
88e2f9ed
JT
61 * If 1, fetch_pack() will also not modify any object flags.
62 * This allows fetch_pack() to safely be called by any function,
63 * regardless of which object flags it uses (if any).
64 */
65 unsigned no_dependents:1;
cf1e7c07
JT
66
67 /*
68 * Because fetch_pack() overwrites the shallow file upon a
69 * successful deepening non-clone fetch, if this struct
70 * specifies such a fetch, fetch_pack() needs to perform a
71 * connectivity check before deciding if a fetch is successful
72 * (and overwriting the shallow file). fetch_pack() sets this
73 * field to 1 if such a connectivity check was performed.
74 *
75 * This is different from check_self_contained_and_connected
76 * in that the former allows existing objects in the
77 * repository to satisfy connectivity needs, whereas the
78 * latter doesn't.
79 */
80 unsigned connectivity_checked:1;
2d4177c0
DB
81};
82
4ba15999 83/*
f2db854d
JH
84 * sought represents remote references that should be updated from.
85 * On return, the names that were found on the remote will have been
86 * marked as such.
4ba15999 87 */
fa740529 88struct ref *fetch_pack(struct fetch_pack_args *args,
0f804b0b 89 int fd[],
63c69453 90 const struct ref *ref,
f2db854d
JH
91 struct ref **sought,
92 int nr_sought,
910650d2 93 struct oid_array *shallow,
9da69a65 94 struct string_list *pack_lockfiles,
685fbd32 95 enum protocol_version version);
2d4177c0 96
e860d96b
MM
97/*
98 * Print an appropriate error message for each sought ref that wasn't
99 * matched. Return 0 if all sought refs were matched, otherwise 1.
100 */
101int report_unmatched_refs(struct ref **sought, int nr_sought);
102
2d4177c0 103#endif