Skip to content

Commit 9dd17fb

Browse files
add error that explains PackageSpec.repo is a private field
1 parent 14831ed commit 9dd17fb

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/API.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,10 @@ end
15571557

15581558
function handle_package_input!(pkg::PackageSpec)
15591559
if pkg.path !== nothing && pkg.url !== nothing
1560-
pkgerror("`path` and `url` are conflicting specifications")
1560+
pkgerror("PackageSpec fields `path` and `url` both set, resulting in conflicting specifications")
1561+
end
1562+
if pkg.repo.source !== nothing || pkg.repo.rev !== nothing || pkg.repo.subdir !== nothing
1563+
pkgerror("The PackageSpec field `repo` is private and should not be set directly")
15611564
end
15621565
pkg.repo = Types.GitRepo(rev = pkg.rev, source = pkg.url !== nothing ? pkg.url : pkg.path,
15631566
subdir = pkg.subdir)

src/Types.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ mutable struct PackageSpec
9292
uuid::Union{Nothing,UUID}
9393
version::Union{Nothing,VersionTypes,String}
9494
tree_hash::Union{Nothing,SHA1}
95-
repo::GitRepo
95+
repo::GitRepo # private
9696
path::Union{Nothing,String}
9797
pinned::Bool
9898
# used for input only

0 commit comments

Comments
 (0)