GunnarFarneback/LocalRegistry.jl

Error message when package repo is dirty

baggepinnen opened this issue · 2 comments

Thanks for this awesome package! I just started using it and noticed that there is an error message when the repo to a package I'm trying to register is dirty. This is very welcome! However, the message says that the registry is dirty rather than the package I'm registering:

julia> register("ClampingID", "CbRegistry")
ERROR: Package directory is dirty. Stash or commit files.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33

maybe the message could indicate if it's the package or the registry being dirty?

I believe these lines do so:

# If the package directory is dirty, a different version could be
# present in Project.toml.
if is_dirty(package_path, gitconfig)
error("Package directory is dirty. Stash or commit files.")
end
registry_path = find_registry_path(registry, pkg)
if is_dirty(registry_path, gitconfig)
error("Registry directory is dirty. Stash or commit files.")
end

Wow, I must have been very tired or something, even the message I reproduced in the issue says "package is dirty". I'm sorry for the noise 😕