]> git.proxmox.com Git - libgit2.git/commitdiff
local transport: catch double-opens
authorCarlos Martín Nieto <cmn@dwim.me>
Fri, 7 Mar 2014 13:58:43 +0000 (14:58 +0100)
committerCarlos Martín Nieto <cmn@dwim.me>
Fri, 7 Mar 2014 15:03:10 +0000 (16:03 +0100)
Combinations of connect + fetch can call local_open multiple
times. Detect this and skip the initialization stage.

src/transports/local.c

index 26ada48e658bec98e8727b98d3e1e0cc1b4088c0..f8d511ed6756e6b94da1066c41215871b26a1a58 100644 (file)
@@ -194,6 +194,9 @@ static int local_connect(
        GIT_UNUSED(cred_acquire_cb);
        GIT_UNUSED(cred_acquire_payload);
 
+       if (t->connected)
+               return 0;
+
        t->url = git__strdup(url);
        GITERR_CHECK_ALLOC(t->url);
        t->direction = direction;