summaryrefslogtreecommitdiff
path: root/connected.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-09-02 23:33:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-09-09 22:19:02 (GMT)
commitf96400cb467af82e21acb3034dd214f4c8be11d0 (patch)
tree42b7f1942b1b04a346112ea3041e816346ae5f99 /connected.h
parentf0e278b1b7a2c0ecbecf644a18c1383dc426db30 (diff)
downloadgit-f96400cb467af82e21acb3034dd214f4c8be11d0.zip
git-f96400cb467af82e21acb3034dd214f4c8be11d0.tar.gz
git-f96400cb467af82e21acb3034dd214f4c8be11d0.tar.bz2
check_everything_connected(): libify
Extract the helper function and the type definition of the iterator function it uses out of builtin/fetch.c into a separate source and a header file. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'connected.h')
-rw-r--r--connected.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/connected.h b/connected.h
new file mode 100644
index 0000000..7e4585a
--- /dev/null
+++ b/connected.h
@@ -0,0 +1,20 @@
+#ifndef CONNECTED_H
+#define CONNECTED_H
+
+/*
+ * Take callback data, and return next object name in the buffer.
+ * When called after returning the name for the last object, return -1
+ * to signal EOF, otherwise return 0.
+ */
+typedef int (*sha1_iterate_fn)(void *, unsigned char [20]);
+
+/*
+ * 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)
+ */
+extern int check_everything_connected(sha1_iterate_fn, int quiet, void *cb_data);
+
+#endif /* CONNECTED_H */