summaryrefslogtreecommitdiff
path: root/src/netops.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-07-03 02:34:32 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-07-03 02:34:32 +0200
commit1380e7c6b1b802efdbbe48edf706e49cc309f370 (patch)
treea6ee9e18f5fdbc6e45a333e98f39e41fad8d0fae /src/netops.c
parent28f087c8642ff9c8dd6964e101e6d8539db6281a (diff)
downloadlibgit2-1380e7c6b1b802efdbbe48edf706e49cc309f370.tar.gz
netops: error out on url without a pathcmn/http-url-path
In order to connect to a remote server, we need to provide a path to the repository we're interested in. Consider the lack of path in the url an error.
Diffstat (limited to 'src/netops.c')
-rw-r--r--src/netops.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/netops.c b/src/netops.c
index 965e4775d..8a60299c2 100644
--- a/src/netops.c
+++ b/src/netops.c
@@ -717,6 +717,9 @@ int gitno_extract_url_parts(
if (u.field_set & (1 << UF_PATH)) {
*path = git__substrdup(_path, u.field_data[UF_PATH].len);
GITERR_CHECK_ALLOC(*path);
+ } else {
+ giterr_set(GITERR_NET, "invalid url, missing path");
+ return GIT_EINVALIDSPEC;
}
if (u.field_set & (1 << UF_USERINFO)) {