@@ -705,7 +705,9 @@ function handle_repo_add!(ctx::Context, pkg::PackageSpec)
705705 end
706706
707707 let repo_source = repo_source
708- LibGit2. with (GitTools. ensure_clone (ctx. io, add_repo_cache_path (repo_source), repo_source; isbare= true )) do repo
708+ # The type-assertions below are necessary presumably due to julia#36454
709+ LibGit2. with (GitTools. ensure_clone (ctx. io, add_repo_cache_path (repo_source:: Union{Nothing,String} ), repo_source:: Union{Nothing,String} ; isbare= true )) do repo
710+ repo_source_typed = repo_source:: Union{Nothing,String}
709711 GitTools. check_valid_HEAD (repo)
710712
711713 # If the user didn't specify rev, assume they want the default (master) branch if on a branch, otherwise the current commit
@@ -717,7 +719,7 @@ function handle_repo_add!(ctx::Context, pkg::PackageSpec)
717719 fetched = false
718720 if obj_branch === nothing
719721 fetched = true
720- GitTools. fetch (ctx. io, repo, repo_source ; refspecs= refspecs)
722+ GitTools. fetch (ctx. io, repo, repo_source_typed ; refspecs= refspecs)
721723 obj_branch = get_object_or_branch (repo, pkg. repo. rev)
722724 if obj_branch === nothing
723725 pkgerror (" Did not find rev $(pkg. repo. rev) in repository" )
@@ -729,7 +731,7 @@ function handle_repo_add!(ctx::Context, pkg::PackageSpec)
729731 innerentry = manifest_info (ctx. env. manifest, pkg. uuid)
730732 ispinned = innerentry != = nothing && innerentry. pinned
731733 if isbranch && ! fetched && ! ispinned
732- GitTools. fetch (ctx. io, repo, repo_source ; refspecs= refspecs)
734+ GitTools. fetch (ctx. io, repo, repo_source_typed ; refspecs= refspecs)
733735 gitobject, isbranch = get_object_or_branch (repo, pkg. repo. rev)
734736 end
735737
0 commit comments