From a09da6ac634926a299dd439da08bdb547a8ca011 Mon Sep 17 00:00:00 2001 From: William Boman Date: Fri, 29 Dec 2023 07:46:43 +0100 Subject: fix(cargo): don't attempt to fetch versions when version targets commit SHA (#1585) --- lua/mason-core/installer/registry/providers/cargo.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lua') 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 { { -- cgit v1.2.3-70-g09d2