summaryrefslogtreecommitdiff
path: root/connected.h
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-08-03 15:10:27 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-08-03 15:10:28 -0700
commita58a8e3f7156dadd5d5e9643168545ff057c111a (patch)
treed84a0f05f8f66b1bcd471ceedb11d0e156e5c5c3 /connected.h
parentMerge branch 'jt/fetch-large-handshake-window-on-http' (diff)
parentreceive-pack: send keepalives during quiet periods (diff)
downloadtgif-a58a8e3f7156dadd5d5e9643168545ff057c111a.tar.xz
Merge branch 'jk/push-progress'
"git push" and "git clone" learned to give better progress meters to the end user who is waiting on the terminal. * jk/push-progress: receive-pack: send keepalives during quiet periods receive-pack: turn on connectivity progress receive-pack: relay connectivity errors to sideband receive-pack: turn on index-pack resolving progress index-pack: add flag for showing delta-resolution progress clone: use a real progress meter for connectivity check check_connected: add progress flag check_connected: relay errors to alternate descriptor check_everything_connected: use a struct with named options check_everything_connected: convert to argv_array rev-list: add optional progress reporting check_everything_connected: always pass --quiet to rev-list
Diffstat (limited to 'connected.h')
-rw-r--r--connected.h37
1 files changed, 31 insertions, 6 deletions
diff --git a/connected.h b/connected.h
index 071d408f38..afa48cc052 100644
--- a/connected.h
+++ b/connected.h
@@ -11,17 +11,42 @@ struct transport;
typedef int (*sha1_iterate_fn)(void *, unsigned char [20]);
/*
+ * Named-arguments struct for check_connected. All arguments are
+ * optional, and can be left to defaults as set by CHECK_CONNECTED_INIT.
+ */
+struct check_connected_options {
+ /* Avoid printing any errors to stderr. */
+ int quiet;
+
+ /* --shallow-file to pass to rev-list sub-process */
+ const char *shallow_file;
+
+ /* Transport whose objects we are checking, if available. */
+ struct transport *transport;
+
+ /*
+ * If non-zero, send error messages to this descriptor rather
+ * than stderr. The descriptor is closed before check_connected
+ * returns.
+ */
+ int err_fd;
+
+ /* If non-zero, show progress as we traverse the objects. */
+ int progress;
+};
+
+#define CHECK_CONNECTED_INIT { 0 }
+
+/*
* Make sure that our object store has all the commits necessary to
* connect the ancestry chain to some of our existing refs, and all
* the trees and blobs that these commits use.
*
* Return 0 if Ok, non zero otherwise (i.e. some missing objects)
+ *
+ * If "opt" is NULL, behaves as if CHECK_CONNECTED_INIT was passed.
*/
-extern int check_everything_connected(sha1_iterate_fn, int quiet, void *cb_data);
-extern int check_shallow_connected(sha1_iterate_fn, int quiet, void *cb_data,
- const char *shallow_file);
-extern int check_everything_connected_with_transport(sha1_iterate_fn, int quiet,
- void *cb_data,
- struct transport *transport);
+int check_connected(sha1_iterate_fn fn, void *cb_data,
+ struct check_connected_options *opt);
#endif /* CONNECTED_H */