Skip to content

Commit

Permalink
give refspecs to the registry (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Apr 26, 2018
1 parent 67fc4fc commit 026bd86
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stdlib/Pkg3/src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function update_registry(ctx)
end
branch = LibGit2.headname(repo)
try
GitTools.fetch(repo)
GitTools.fetch(repo; refspecs=["+refs/heads/$branch:refs/remotes/origin/$branch"])
catch e
e isa LibGit2.GitError || rethrow(e)
push!(errors, (reg, "failed to fetch from repo"))
Expand Down
1 change: 0 additions & 1 deletion stdlib/Pkg3/src/GitTools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ function showprogress(io::IO, p::MiniProgressBar)
end

function transfer_progress(progress::Ptr{LibGit2.TransferProgress}, p::Any)

progress = unsafe_load(progress)
@assert haskey(p, :transfer_progress)
bar = p[:transfer_progress]
Expand Down
7 changes: 6 additions & 1 deletion stdlib/Pkg3/src/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,12 @@ function handle_repos_add!(ctx::Context, pkgs::AbstractVector{PackageSpec}; upgr
pinned = (info != nothing && get(info, "pinned", false))
if upgrade_or_add && !pinned && !just_cloned
rev = pkg.repo.rev
GitTools.fetch(repo, pkg.repo.url; refspecs=refspecs, credentials=creds)
try
GitTools.fetch(repo, pkg.repo.url; refspecs=refspecs, credentials=creds)
catch e
e isa LibGit2.GitError || rethrow(e)
cmderror("failed to fetch from $(pkg.repo.url), error: $e")
end
end
if upgrade_or_add && !pinned
rev = pkg.repo.rev
Expand Down

0 comments on commit 026bd86

Please sign in to comment.