diff --git a/stdlib/Pkg/src/Display.jl b/stdlib/Pkg/src/Display.jl index a286940e1bcb1..05306b19f93d2 100644 --- a/stdlib/Pkg/src/Display.jl +++ b/stdlib/Pkg/src/Display.jl @@ -168,7 +168,7 @@ 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, " ") @@ -176,12 +176,12 @@ function print_diff(io::IO, ctx::Context, diff::Vector{DiffEntry}, status=false) 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}() diff --git a/stdlib/Pkg/src/Operations.jl b/stdlib/Pkg/src/Operations.jl index 34497cff3faff..d7ebbe02a39f0 100644 --- a/stdlib/Pkg/src/Operations.jl +++ b/stdlib/Pkg/src/Operations.jl @@ -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