Merge branch 'tb/ref-filter-empty-modifier'
[alt-git.git] / connected.h
blob4ca325f79dc5ee45823834f71f66a6d3b278c3e5
1 #ifndef CONNECTED_H
2 #define CONNECTED_H
4 struct transport;
6 /*
7 * Take callback data, and return next object name in the buffer.
8 * When called after returning the name for the last object, return -1
9 * to signal EOF, otherwise return 0.
11 typedef int (*sha1_iterate_fn)(void *, unsigned char [20]);
14 * Named-arguments struct for check_connected. All arguments are
15 * optional, and can be left to defaults as set by CHECK_CONNECTED_INIT.
17 struct check_connected_options {
18 /* Avoid printing any errors to stderr. */
19 int quiet;
21 /* --shallow-file to pass to rev-list sub-process */
22 const char *shallow_file;
24 /* Transport whose objects we are checking, if available. */
25 struct transport *transport;
28 * If non-zero, send error messages to this descriptor rather
29 * than stderr. The descriptor is closed before check_connected
30 * returns.
32 int err_fd;
34 /* If non-zero, show progress as we traverse the objects. */
35 int progress;
38 * Insert these variables into the environment of the child process.
40 const char **env;
43 #define CHECK_CONNECTED_INIT { 0 }
46 * Make sure that our object store has all the commits necessary to
47 * connect the ancestry chain to some of our existing refs, and all
48 * the trees and blobs that these commits use.
50 * Return 0 if Ok, non zero otherwise (i.e. some missing objects)
52 * If "opt" is NULL, behaves as if CHECK_CONNECTED_INIT was passed.
54 int check_connected(sha1_iterate_fn fn, void *cb_data,
55 struct check_connected_options *opt);
57 #endif /* CONNECTED_H */