interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / connected.h

74 lines · 2028 bytes Raw Blame History
1#ifndef CONNECTED_H
2#define CONNECTED_H
3
4struct object_id;
5struct repository;
6struct transport;
7
8/*
9 * Take callback data, and return next object name in the buffer.
10 * When called after returning the name for the last object, return -1
11 * to signal EOF, otherwise return 0.
12 */
13typedef const struct object_id *(*oid_iterate_fn)(void *);
14
15/*
16 * Named-arguments struct for check_connected. All arguments are
17 * optional, and can be left to defaults as set by CHECK_CONNECTED_INIT.
18 */
19struct check_connected_options {
20 /* Avoid printing any errors to stderr. */
21 int quiet;
22
23 /* --shallow-file to pass to rev-list sub-process */
24 const char *shallow_file;
25
26 /* Transport whose objects we are checking, if available. */
27 struct transport *transport;
28
29 /*
30 * If non-zero, send error messages to this descriptor rather
31 * than stderr. The descriptor is closed before check_connected
32 * returns.
33 */
34 int err_fd;
35
36 /* If non-zero, show progress as we traverse the objects. */
37 int progress;
38
39 /*
40 * Insert these variables into the environment of the child process.
41 */
42 const char **env;
43
44 /*
45 * If non-zero, check the ancestry chain completely, not stopping at
46 * any existing ref. This is necessary when deepening existing refs
47 * during a fetch.
48 */
49 unsigned is_deepening_fetch : 1;
50
51 /*
52 * If not NULL, use `--exclude-hidden=$section` to exclude all refs
53 * hidden via the `$section.hideRefs` config from the set of
54 * already-reachable refs.
55 */
56 const char *exclude_hidden_refs_section;
57};
58
59#define CHECK_CONNECTED_INIT { 0 }
60
61/*
62 * Make sure that all given objects and all objects reachable from them
63 * either exist in our object store or (if the repository is a partial
64 * clone) are promised to be available.
65 *
66 * Return 0 if Ok, non zero otherwise (i.e. some missing objects)
67 *
68 * If "opt" is NULL, behaves as if CHECK_CONNECTED_INIT was passed.
69 */
70int check_connected(struct repository *repo,
71 oid_iterate_fn fn, void *cb_data,
72 struct check_connected_options *opt);
73
74#endif /* CONNECTED_H */