Commit b233714360fc196ecf1d07f3779d995628af3c89

Vicent Marti 2011-11-28T18:46:25

remote: Fix connected test

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/remote.c b/src/remote.c
index 75e8616..eca3f77 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -241,7 +241,7 @@ int git_remote_ls(git_remote *remote, git_headlist_cb list_cb, void *payload)
 {
 	assert(remote);
 
-	if (!remote->transport)
+	if (!remote->transport || !remote->transport->connected)
 		return git__throw(GIT_ERROR, "The remote is not connected");
 
 	return remote->transport->ls(remote->transport, list_cb, payload);