From 43b24446f3124b75ca1177767540103f6393637d Mon Sep 17 00:00:00 2001 From: eejebring Date: Fri, 21 Aug 2026 23:28:13 +0200 Subject: [PATCH] debug --- git.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/git.lua b/git.lua index bb51112..56bb02a 100644 --- a/git.lua +++ b/git.lua @@ -41,7 +41,6 @@ local GIT_FILE = "git.lua" function string.beginsWith(str, comp) local compLen = string.len(comp) local begining = string.sub(str, 0, compLen) - print(begining == comp, begining, comp) return begining == comp end @@ -73,7 +72,6 @@ local function parseGiteaURL(url) origin = "", owner = "", repo = "", - --branch = "", treeUrl = "", } local lowerUrl = string.lower(url) @@ -88,7 +86,6 @@ local function parseGiteaURL(url) local protoLen = string.len(info.protocol) local endLen = string.len(ending) local cleaned = string.sub(url, protoLen + 1, urlLen - endLen) - print("cleaned", cleaned) local urlParts = string.split(cleaned, "/") if not (#urlParts) == 3 then error("Unexpected link length.") end @@ -96,10 +93,15 @@ local function parseGiteaURL(url) info.treeUrl = ("%s%s/api/v1/repos/%s/%s/git/trees/%s%s?recursive=1") - :format(info.protocol, info.base, info.owner, info.repo, ending) - + :format(info.protocol, info.origin, info.owner, info.repo, ending) + print() + print("protocol: ", info.protocol) + print("origin: ", info.origin) + print("owner: ", info.owner) + print("repo: ", info.repo) + print("treeUrl: ", info.treeUrl) for k, v in pairs(info) do - if v == "" then + if v == "" or v == nil then error("Could not parse " .. k .. " from link.") end end