Skip to content

Commit f8c1d4b

Browse files
StefanKarpinskiajkeller34
authored andcommitted
work-around joinpath error when cloning git ssh urls (fix JuliaLang#20695)
1 parent 17bee34 commit f8c1d4b

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

base/pkg/entry.jl

+13-11
Original file line numberDiff line numberDiff line change
@@ -207,18 +207,20 @@ function clone(url::AbstractString, pkg::AbstractString)
207207
end
208208

209209
function clone(url_or_pkg::AbstractString)
210-
urlpath = joinpath("METADATA",url_or_pkg,"url")
211-
if !(':' in url_or_pkg) && isfile(urlpath)
212-
pkg = url_or_pkg
213-
url = readchomp(urlpath)
214-
# TODO: Cache.prefetch(pkg,url)
215-
else
216-
url = url_or_pkg
217-
m = match(r"(?:^|[/\\])(\w+?)(?:\.jl)?(?:\.git)?$", url)
218-
m !== nothing || throw(PkgError("can't determine package name from URL: $url"))
219-
pkg = m.captures[1]
210+
if !(':' in url_or_pkg)
211+
urlpath = joinpath("METADATA",url_or_pkg,"url")
212+
if isfile(urlpath)
213+
pkg = url_or_pkg
214+
url = readchomp(urlpath)
215+
# TODO: Cache.prefetch(pkg,url)
216+
return clone(url,pkg)
217+
end
220218
end
221-
clone(url,pkg)
219+
url = url_or_pkg
220+
m = match(r"(?:^|[/\\])(\w+?)(?:\.jl)?(?:\.git)?$", url)
221+
m !== nothing || throw(PkgError("can't determine package name from URL: $url"))
222+
pkg = m.captures[1]
223+
return clone(url,pkg)
222224
end
223225

224226
function checkout(pkg::AbstractString, branch::AbstractString, do_merge::Bool, do_pull::Bool)

0 commit comments

Comments
 (0)