Skip to content

Commit d57e20b

Browse files
KristofferCKristofferC
authored andcommitted
don't use tree hash from manifest if the path is set from sources (#4260)
Co-authored-by: KristofferC <[email protected]> (cherry picked from commit a420462)
1 parent e2144b5 commit d57e20b

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/API.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,9 @@ function up(ctx::Context, pkgs::Vector{PackageSpec};
389389
manifest_resolve!(ctx.env.manifest, pkgs)
390390
ensure_resolved(ctx, ctx.env.manifest, pkgs)
391391
end
392-
392+
for pkg in pkgs
393+
update_source_if_set(ctx.env.project, pkg)
394+
end
393395
Operations.up(ctx, pkgs, level; skip_writing_project, preserve)
394396
return
395397
end

src/Operations.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1745,7 +1745,9 @@ function up_load_versions!(ctx::Context, pkg::PackageSpec, entry::PackageEntry,
17451745
entry.version !== nothing || return false # no version to set
17461746
if entry.pinned || level == UPLEVEL_FIXED
17471747
pkg.version = entry.version
1748-
pkg.tree_hash = entry.tree_hash
1748+
if pkg.path === nothing
1749+
pkg.tree_hash = entry.tree_hash
1750+
end
17491751
elseif entry.repo.source !== nothing || source_repo.source !== nothing # repo packages have a version but are treated specially
17501752
if source_repo.source !== nothing
17511753
pkg.repo = source_repo

src/manifest.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ function destructure(manifest::Manifest)::Dict
288288
end
289289

290290
for (uuid, entry) in manifest
291+
# https://github.com/JuliaLang/Pkg.jl/issues/4086
292+
@assert !(entry.tree_hash !== nothing && entry.path !== nothing)
293+
291294
new_entry = something(entry.other, Dict{String,Any}())
292295
new_entry["uuid"] = string(uuid)
293296
entry!(new_entry, "version", entry.version)

0 commit comments

Comments
 (0)