Windows: avoid the "dup dance" when spawning a child process
[gitweb.git] / transport.h
index 503db11701b44766716bbe435e58a69d0d36b871..97ba2519dd6db2a4341def590e06cbc81b33fed2 100644 (file)
@@ -4,6 +4,15 @@
 #include "cache.h"
 #include "remote.h"
 
+struct git_transport_options {
+       unsigned thin : 1;
+       unsigned keep : 1;
+       unsigned followtags : 1;
+       int depth;
+       const char *uploadpack;
+       const char *receivepack;
+};
+
 struct transport {
        struct remote *remote;
        const char *url;
@@ -55,6 +64,8 @@ struct transport {
         **/
        int (*push_refs)(struct transport *transport, struct ref *refs, int flags);
        int (*push)(struct transport *connection, int refspec_nr, const char **refspec, int flags);
+       int (*connect)(struct transport *connection, const char *name,
+                      const char *executable, int fd[2]);
 
        /** get_refs_list(), fetch(), and push_refs() can keep
         * resources (such as a connection) reserved for futher
@@ -62,9 +73,15 @@ struct transport {
         **/
        int (*disconnect)(struct transport *connection);
        char *pack_lockfile;
-       signed verbose : 2;
+       signed verbose : 3;
        /* Force progress even if the output is not a tty */
        unsigned progress : 1;
+       /*
+        * If transport is at least potentially smart, this points to
+        * git_transport_options structure to use in case transport
+        * actually turns out to be smart.
+        */
+       struct git_transport_options *smart_options;
 };
 
 #define TRANSPORT_PUSH_ALL 1
@@ -115,6 +132,11 @@ int transport_fetch_refs(struct transport *transport, struct ref *refs);
 void transport_unlock_pack(struct transport *transport);
 int transport_disconnect(struct transport *transport);
 char *transport_anonymize_url(const char *url);
+void transport_take_over(struct transport *transport,
+                        struct child_process *child);
+
+int transport_connect(struct transport *transport, const char *name,
+                     const char *exec, int fd[2]);
 
 /* Transport methods defined outside transport.c */
 int transport_helper_init(struct transport *transport, const char *name);