Skip to content

Commit

Permalink
fix bug in updating packages from git
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed May 23, 2018
1 parent 39a88fd commit aaddd3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions stdlib/Pkg/src/Display.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,20 +168,20 @@ function print_diff(io::IO, ctx::Context, diff::Vector{DiffEntry}, status=false)
vstr = "[unknown]"
end
v = same ? "" : " $verb"
if verb != '-' && status == true && !package_downloaded
if verb != '-' && status && !package_downloaded
printstyled(io, "", color=:red)
else
print(io, " ")
end
printstyled(io, " [$(string(x.uuid)[1:8])]"; color = color_dark)
printstyled(io, "$v $(x.name) $vstr\n"; color = colors[verb])
end
if status == true && some_packages_not_downloaded
if status && some_packages_not_downloaded
@warn "Some packages (indicated with a red arrow) are not downloaded, use `instantiate` to instantiate the current environment"
end
end
# TODO: Use the Context stream
print_diff(ctx::Context, diff::Vector{DiffEntry}, status=true) = print_diff(stdout, ctx, diff, status)
print_diff(ctx::Context, diff::Vector{DiffEntry}, status=false) = print_diff(stdout, ctx, diff, status)

function manifest_by_uuid(manifest::Dict)
entries = Dict{UUID,Dict}()
Expand Down
5 changes: 2 additions & 3 deletions stdlib/Pkg/src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -423,14 +423,13 @@ function install_git(
GitTools.clone(urls[1], repo_path; isbare=true, header = "[$uuid] $name from $(urls[1])", credentials=creds)
end
git_hash = LibGit2.GitHash(hash.bytes)
for i = 2:length(urls)
try with(LibGit2.GitObject, repo, git_hash) do g
for url in urls
try LibGit2.with(LibGit2.GitObject, repo, git_hash) do g
end
break # object was found, we can stop
catch err
err isa LibGit2.GitError && err.code == LibGit2.Error.ENOTFOUND || rethrow(err)
end
url = urls[i]
GitTools.fetch(repo, url, refspecs=refspecs, credentials=creds)
end
tree = try
Expand Down

0 comments on commit aaddd3a

Please sign in to comment.