We’ve been using the package manager heavily ever since 1.0, with a dedicated private git server that contains bare git repos. Everything has always worked fine, but suddenly I find myself unable to add one of our packages:
pkg> add git://git/MyProject
Updating git-repo `git://git/MyProject`
ERROR: GitError(Code:EUNBORNBRANCH, Class:Reference, reference 'refs/heads/master' not found)
Stacktrace:
[1] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/LibGit2/src/error.jl:101 [inlined]
[2] head(::LibGit2.GitRepo) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/LibGit2/src/reference.jl:44
[3] branch(::LibGit2.GitRepo) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/LibGit2/src/LibGit2.jl:368
[4] (::getfield(Pkg.Types, Symbol("##83#86")))(::LibGit2.GitRepo) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Pkg/src/Types.jl:622
[5] with(::getfield(Pkg.Types, Symbol("##83#86")), ::LibGit2.GitRepo) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/LibGit2/src/types.jl:1125
[6] guess_rev(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Pkg/src/Types.jl:621
[7] resolve_repo_add!(::Pkg.Types.Context, ::Pkg.Types.PackageSpec) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Pkg/src/Types.jl:691
[8] handle_repo_add!(::Pkg.Types.Context, ::Pkg.Types.PackageSpec) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Pkg/src/Types.jl:706
[9] handle_repos_add!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Pkg/src/Types.jl:725
[10] #add#25(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Pkg.API.add), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Pkg/src/API.jl:87
That package has been added/updated lots of times without issue. Other packages have no such problem. Adding the package in a fresh environment causes the same issue. I can git clone
the repo just fine. And the refs/heads/master
file definitely exists on the git server. Does anyone have any idea? pkg> gc
didn’t help either.