librelist archives

« back to archive

local (file://) transport segfaults w/ negotiate_fetch()

local (file://) transport segfaults w/ negotiate_fetch()

From:
Date:
2012-05-16 @ 20:52
local transport segfaults when attempting negotiate_fetch().

I stubbed out the called transport function which now returns a useful
error message:


===================


diff --git a/src/transports/local.c b/src/transports/local.c
index 5dc3501..2954ac2 100644
--- a/src/transports/local.c
+++ b/src/transports/local.c
@@ -205,6 +205,13 @@ static void local_free(git_transport *transport)
        git__free(t);
 }
 
+static int local_negotiate_fetch(git_transport *transport, git_repository
*repo, const git_vector *wants)
+{
+  giterr_set(GITERR_NET, "negotiate_fetch() by local transport is not 
implemented.");
+  return -1;
+}
+
 /**************
  * Public API *
  **************/
@@ -220,6 +227,7 @@ int git_transport_local(git_transport **out)
 
        t->parent.connect = local_connect;
        t->parent.ls = local_ls;
+       t->parent.negotiate_fetch = local_negotiate_fetch;
        t->parent.close = local_close;
        t->parent.free = local_free;


-- 
Brad Harder
Method Logic Digital Consulting
http://methodlogic.net/
http://twitter.com/bcharder