Merge branch 'pw/am-rebase-read-author-script'
[gitweb.git] / transport-internal.h
index 3c1a29d7274465b977d9285781673f235e66ad21..004bee5e368f24963d925af997aec051189e1acf 100644 (file)
@@ -3,8 +3,15 @@
 
 struct ref;
 struct transport;
+struct argv_array;
 
 struct transport_vtable {
+       /**
+        * This transport supports the fetch() function being called
+        * without get_refs_list() first being called.
+        */
+       unsigned fetch_without_list : 1;
+
        /**
         * Returns 0 if successful, positive if the option is not
         * recognized or is inapplicable, and negative if the option
@@ -17,11 +24,19 @@ struct transport_vtable {
         * the transport to try to share connections, for_push is a
         * hint as to whether the ultimate operation is a push or a fetch.
         *
+        * If communicating using protocol v2 a list of prefixes can be
+        * provided to be sent to the server to enable it to limit the ref
+        * advertisement.  Since ref filtering is done on the server's end, and
+        * only when using protocol v2, this list will be ignored when not
+        * using protocol v2 meaning this function can return refs which don't
+        * match the provided ref_prefixes.
+        *
         * If the transport is able to determine the remote hash for
         * the ref without a huge amount of effort, it should store it
         * in the ref's old_sha1 field; otherwise it should be all 0.
         **/
-       struct ref *(*get_refs_list)(struct transport *transport, int for_push);
+       struct ref *(*get_refs_list)(struct transport *transport, int for_push,
+                                    const struct argv_array *ref_prefixes);
 
        /**
         * Fetch the objects for the given refs. Note that this gets