Skip to content

Commit

Permalink
Fix gc: git_tree_sha should be repo.tree_sha
Browse files Browse the repository at this point in the history
  • Loading branch information
00vareladavid committed Dec 23, 2018
1 parent 2ab9360 commit d668e4e
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 d668e4e

Please sign in to comment.