aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2023-12-29 07:46:43 +0100
committerGitHub <noreply@github.com>2023-12-29 07:46:43 +0100
commita09da6ac634926a299dd439da08bdb547a8ca011 (patch)
tree1bd436c7e8fca5383257467b048cae51eaf0b2a4 /lua/mason-core
parentchore(main): release 1.8.3 (#1555) (diff)
downloadmason-a09da6ac634926a299dd439da08bdb547a8ca011.tar
mason-a09da6ac634926a299dd439da08bdb547a8ca011.tar.gz
mason-a09da6ac634926a299dd439da08bdb547a8ca011.tar.bz2
mason-a09da6ac634926a299dd439da08bdb547a8ca011.tar.lz
mason-a09da6ac634926a299dd439da08bdb547a8ca011.tar.xz
mason-a09da6ac634926a299dd439da08bdb547a8ca011.tar.zst
mason-a09da6ac634926a299dd439da08bdb547a8ca011.zip
fix(cargo): don't attempt to fetch versions when version targets commit SHA (#1585)
Diffstat (limited to 'lua/mason-core')
-rw-r--r--lua/mason-core/installer/registry/providers/cargo.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/lua/mason-core/installer/registry/providers/cargo.lua b/lua/mason-core/installer/registry/providers/cargo.lua
index af43db86..f4904b73 100644
--- a/lua/mason-core/installer/registry/providers/cargo.lua
+++ b/lua/mason-core/installer/registry/providers/cargo.lua
@@ -60,7 +60,14 @@ end
function M.get_versions(purl)
---@type string?
local repository_url = _.path({ "qualifiers", "repository_url" }, purl)
+ local rev = _.path({ "qualifiers", "rev" }, purl)
if repository_url then
+ if rev == "true" then
+ -- When ?rev=true we're targeting a commit SHA. It's not feasible to retrieve all commit SHAs for a
+ -- repository so we fail instead.
+ return Result.failure "Unable to retrieve commit SHAs."
+ end
+
---@type Result?
local git_tags = _.cond {
{