summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-03-07 14:58:43 +0100
committerCarlos Martín Nieto <cmn@dwim.me>2014-03-07 16:03:10 +0100
commit5187b609ba203b5a62e3e54c1a323cc0647deff9 (patch)
tree196be762a551aa218c63d0ae2b14678043cb24b2 /src
parentc81e4adfd779a5bf8dd91539dda2dc0636abfc9d (diff)
downloadlibgit2-5187b609ba203b5a62e3e54c1a323cc0647deff9.tar.gz
local transport: catch double-opens
Combinations of connect + fetch can call local_open multiple times. Detect this and skip the initialization stage.
Diffstat (limited to 'src')
-rw-r--r--src/transports/local.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/transports/local.c b/src/transports/local.c
index 26ada48e6..f8d511ed6 100644
--- a/src/transports/local.c
+++ b/src/transports/local.c
@@ -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;