Commit 44bc0c6ac3b939d3dfc1102be77e82e00e919ae4

nulltoken 2013-08-21T13:20:17

remote: Warn the user when connecting with no url

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/remote.c b/src/remote.c
index 14ed740..948c755 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -558,8 +558,11 @@ int git_remote_connect(git_remote *remote, git_direction direction)
 	t = remote->transport;
 
 	url = git_remote__urlfordirection(remote, direction);
-	if (url == NULL )
+	if (url == NULL ) {
+		giterr_set(GITERR_INVALID,
+			"Malformed remote '%s' - missing URL", remote->name);
 		return -1;
+	}
 
 	/* A transport could have been supplied in advance with
 	 * git_remote_set_transport */