Skip to content

Commit 8d77007

Browse files
StefanKarpinskiKristofferC
authored andcommitted
only use git on Windows for default pkg server (#2364)
(cherry picked from commit 7bf206e)
1 parent 58b7d73 commit 8d77007

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Types.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,9 @@ end
986986

987987
pkg_server_url_hash(url::String) = split(url, '/')[end]
988988

989+
registry_use_pkg_server() =
990+
!Sys.iswindows() || haskey(ENV, "JULIA_PKG_SERVER")
991+
989992
# entry point for `registry add`
990993
function clone_or_cp_registries(ctx::Context, regs::Vector{RegistrySpec}, depot::String=depots1())
991994
populate_known_registries_with_urls!(regs)
@@ -998,7 +1001,7 @@ function clone_or_cp_registries(ctx::Context, regs::Vector{RegistrySpec}, depot:
9981001
mktempdir() do tmp
9991002
url, registry_urls = pkg_server_registry_url(reg.uuid, registry_urls)
10001003
# on Windows we prefer git cloning because untarring is so slow
1001-
if !Sys.iswindows() && url !== nothing
1004+
if url !== nothing && registry_use_pkg_server()
10021005
# download from Pkg server
10031006
try
10041007
download_verify_unpack(url, nothing, tmp, ignore_existence = true)

0 commit comments

Comments
 (0)