]> git.ipfire.org Git - thirdparty/git.git/blame - connected.h
t4216: avoid unnecessary subshell in test_bloom_filters_not_used
[thirdparty/git.git] / connected.h
CommitLineData
f96400cb
JH
1#ifndef CONNECTED_H
2#define CONNECTED_H
3
ef3ca954 4struct object_id;
c6807a40
NTND
5struct transport;
6
f96400cb
JH
7/*
8 * Take callback data, and return next object name in the buffer.
9 * When called after returning the name for the last object, return -1
10 * to signal EOF, otherwise return 0.
11 */
6ccac9ee 12typedef int (*oid_iterate_fn)(void *, struct object_id *oid);
f96400cb 13
7043c707
JK
14/*
15 * Named-arguments struct for check_connected. All arguments are
16 * optional, and can be left to defaults as set by CHECK_CONNECTED_INIT.
17 */
18struct check_connected_options {
19 /* Avoid printing any errors to stderr. */
20 int quiet;
21
22 /* --shallow-file to pass to rev-list sub-process */
23 const char *shallow_file;
24
25 /* Transport whose objects we are checking, if available. */
26 struct transport *transport;
e0331849
JK
27
28 /*
29 * If non-zero, send error messages to this descriptor rather
30 * than stderr. The descriptor is closed before check_connected
31 * returns.
32 */
33 int err_fd;
70d5e2d7
JK
34
35 /* If non-zero, show progress as we traverse the objects. */
36 int progress;
526f108a
JK
37
38 /*
39 * Insert these variables into the environment of the child process.
40 */
41 const char **env;
cf1e7c07
JT
42
43 /*
44 * If non-zero, check the ancestry chain completely, not stopping at
45 * any existing ref. This is necessary when deepening existing refs
46 * during a fetch.
47 */
48 unsigned is_deepening_fetch : 1;
dfa33a29
JS
49
50 /*
50033772
JT
51 * If non-zero, only check that the top-level objects referenced by the
52 * wanted refs (passed in as cb_data) are promisor objects. This is
53 * useful for partial clones, where enumerating and excluding all
54 * promisor objects is very slow and the commit-walk itself becomes a
55 * no-op.
dfa33a29 56 */
50033772 57 unsigned check_refs_are_promisor_objects_only : 1;
7043c707
JK
58};
59
60#define CHECK_CONNECTED_INIT { 0 }
61
f96400cb 62/*
4937291b
JT
63 * Make sure that all given objects and all objects reachable from them
64 * either exist in our object store or (if the repository is a partial
65 * clone) are promised to be available.
f96400cb
JH
66 *
67 * Return 0 if Ok, non zero otherwise (i.e. some missing objects)
7043c707
JK
68 *
69 * If "opt" is NULL, behaves as if CHECK_CONNECTED_INIT was passed.
f96400cb 70 */
6ccac9ee 71int check_connected(oid_iterate_fn fn, void *cb_data,
7043c707 72 struct check_connected_options *opt);
f96400cb
JH
73
74#endif /* CONNECTED_H */