Commit 5187b609ba203b5a62e3e54c1a323cc0647deff9

Carlos Martín Nieto 2014-03-07T14:58:43

local transport: catch double-opens Combinations of connect + fetch can call local_open multiple times. Detect this and skip the initialization stage.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/transports/local.c b/src/transports/local.c
index 26ada48..f8d511e 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;