Skip to content

Commit

Permalink
Merge #975
Browse files Browse the repository at this point in the history
975: Fix `gc`: `git_tree_sha` should be `repo.tree_sha` r=00vareladavid a=00vareladavid

Fixes #974 

Co-authored-by: David Varela <[email protected]>
  • Loading branch information
bors[bot] and 00vareladavid committed Dec 24, 2018
2 parents 2ab9360 + d668e4e commit 01f8655
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ function gc(ctx::Context=Context(); kwargs...)
manifest == nothing && continue
new_usage[manifestfile] = [Dict("time" => date)]
for (uuid, entry) in manifest
if entry.git_tree_sha !== nothing
if entry.repo.tree_sha !== nothing
push!(paths_to_keep,
Operations.find_installed(entry.name, uuid, entry.git_tree_sha))
Operations.find_installed(entry.name, uuid, entry.repo.tree_sha))
end
end
end
Expand Down
10 changes: 10 additions & 0 deletions test/pkg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,16 @@ end
end
end

#issue #975
@testset "Pkg.gc" begin
temp_pkg_dir() do project_path
with_temp_env() do
Pkg.add("Example")
Pkg.gc()
end
end
end

include("repl.jl")
include("api.jl")
include("registry.jl")
Expand Down

0 comments on commit 01f8655

Please sign in to comment.