summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cd0f8e6)
raw | patch | inline | side by side (parent: cd0f8e6)
author | Daniel Barkalow <barkalow@iabervon.org> | |
Wed, 18 Nov 2009 01:42:21 +0000 (02:42 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 18 Nov 2009 05:39:58 +0000 (21:39 -0800) |
Since some cases may need to disconnect from the helper and reconnect,
wrap the function that just disconnects in a function that also frees
transport->data.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
wrap the function that just disconnects in a function that also frees
transport->data.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
transport-helper.c | patch | blob | history |
diff --git a/transport-helper.c b/transport-helper.c
index f57e84c67641b5a03ba8d9ed5182507bb54dcd15..e24fcbb17d0bb6e28bd8c83ec55a5ce3e8bbc88e 100644 (file)
--- a/transport-helper.c
+++ b/transport-helper.c
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)
{
transport->data = data;
transport->get_refs_list = get_refs_list;
transport->fetch = fetch;
- transport->disconnect = disconnect_helper;
+ transport->disconnect = release_helper;
return 0;
}