]> git.ipfire.org Git - thirdparty/git.git/blobdiff - transport-helper.c
Allow specifying the remote helper in the url
[thirdparty/git.git] / transport-helper.c
index f57e84c67641b5a03ba8d9ed5182507bb54dcd15..53d8f08ee9cd3ead105953940d7ad42028b6ab4a 100644 (file)
@@ -67,8 +67,15 @@ static int disconnect_helper(struct transport *transport)
        return 0;
 }
 
+static int release_helper(struct transport *transport)
+{
+       disconnect_helper(transport);
+       free(transport->data);
+       return 0;
+}
+
 static int fetch_with_fetch(struct transport *transport,
-                           int nr_heads, const struct ref **to_fetch)
+                           int nr_heads, struct ref **to_fetch)
 {
        struct child_process *helper = get_helper(transport);
        FILE *file = xfdopen(helper->out, "r");
@@ -92,7 +99,7 @@ static int fetch_with_fetch(struct transport *transport,
 }
 
 static int fetch(struct transport *transport,
-                int nr_heads, const struct ref **to_fetch)
+                int nr_heads, struct ref **to_fetch)
 {
        struct helper_data *data = transport->data;
        int i, count;
@@ -163,6 +170,6 @@ int transport_helper_init(struct transport *transport, const char *name)
        transport->data = data;
        transport->get_refs_list = get_refs_list;
        transport->fetch = fetch;
-       transport->disconnect = disconnect_helper;
+       transport->disconnect = release_helper;
        return 0;
 }