aboutsummaryrefslogtreecommitdiff
path: root/src/lpm.lua
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2023-01-22 13:56:57 -0500
committerAdam Harrison <adamdharrison@gmail.com>2023-01-22 13:56:57 -0500
commitad9ee6370dde937213dfd55dcaa1ebd2662d4e26 (patch)
tree729dca61661cf57cde9c6efa8ae56845d5a1fe05 /src/lpm.lua
parentcb2b71a2eed6043ef3cb3b0f6b40845e825d9174 (diff)
downloadlite-xl-plugin-manager-ad9ee6370dde937213dfd55dcaa1ebd2662d4e26.tar.gz
lite-xl-plugin-manager-ad9ee6370dde937213dfd55dcaa1ebd2662d4e26.zip
Better error message when not specifying a commit or branch.
Diffstat (limited to 'src/lpm.lua')
-rw-r--r--src/lpm.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lpm.lua b/src/lpm.lua
index 5a95b90..d0f7122 100644
--- a/src/lpm.lua
+++ b/src/lpm.lua
@@ -815,6 +815,7 @@ end
function Repository.__index(self, idx) return rawget(self, idx) or Repository[idx] end
function Repository.new(hash)
if not hash.remote then error("requires a remote") end
+ if not hash.commit and not hash.branch then error("requires either a branch or commit specifier") end
if not hash.remote:find("^%w+:") and system.stat(hash.remote .. "/.git") then hash.remote = "file://" .. system.stat(hash.remote).abs_path end
if not hash.remote:find("^https?:") and not hash.remote:find("^file:") then error("only repositories with http and file transports are supported (" .. hash.remote .. ")") end
local self = setmetatable({