From 3c62386a396ae0c1cd7adbaacc379eb4af072a65 Mon Sep 17 00:00:00 2001 From: William Boman Date: Mon, 15 Aug 2022 21:03:06 +0200 Subject: refactor: introduce selene, harden type defs, and use proper EmmyLua syntax (#296) --- lua/mason-core/managers/git/init.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lua/mason-core/managers/git/init.lua') diff --git a/lua/mason-core/managers/git/init.lua b/lua/mason-core/managers/git/init.lua index c363cbe8..aea3b47f 100644 --- a/lua/mason-core/managers/git/init.lua +++ b/lua/mason-core/managers/git/init.lua @@ -14,7 +14,7 @@ local function with_receipt(repo) end ---@async ----@param opts {[1]: string, recursive: boolean, version: Optional|nil}: The first item in the table is the repository to clone. +---@param opts {[1]: string, recursive: boolean, version: Optional?} The first item in the table is the repository to clone. function M.clone(opts) local ctx = installer.context() local repo = assert(opts[1], "No git URL provided.") @@ -37,7 +37,7 @@ function M.clone(opts) end ---@async ----@param receipt InstallReceipt +---@param receipt InstallReceipt ---@param install_dir string function M.check_outdated_git_clone(receipt, install_dir) if receipt.primary_source.type ~= "git" then @@ -51,14 +51,14 @@ function M.check_outdated_git_clone(receipt, install_dir) end return { name = receipt.primary_source.remote, - current_version = assert(local_head), - latest_version = assert(remote_head), + current_version = assert(local_head, "no local HEAD"), + latest_version = assert(remote_head, "no remote HEAD"), } end) end ---@async ----@param receipt InstallReceipt +---@param receipt InstallReceipt ---@param install_dir string function M.get_installed_revision(receipt, install_dir) return spawn -- cgit v1.2.3-70-g09d2