From 7edbdb5c2057a8d3786cc9e3e73f62c4b6858a6d Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Fri, 8 Nov 2024 09:30:50 -0500 Subject: Changed erroneous return; thanks to Jan for reporting. --- src/lpm.c | 3 +-- src/lpm.lua | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lpm.c b/src/lpm.c index 22532c5..227533b 100644 --- a/src/lpm.c +++ b/src/lpm.c @@ -691,8 +691,7 @@ static int lpm_fetch(lua_State* L) { int ctx = luaL_ref(L, LUA_REGISTRYINDEX); if (lua_is_main_thread(L)) { lpm_fetch_thread(context); - lpm_fetchk(L, 0, ctx); - return 0; + return lpm_fetchk(L, 0, ctx); } else { context->thread = create_thread(lpm_fetch_thread, context); return lua_yieldk(L, 0, (lua_KContext)ctx, lpm_fetchk); diff --git a/src/lpm.lua b/src/lpm.lua index c77e511..450c8d2 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -1258,8 +1258,9 @@ function Repository:fetch() common.mkdirp(temporary_path) log.progress_action("Fetching " .. self.remote .. "...") system.init(temporary_path, self.remote) - self.branch = system.fetch(temporary_path, write_progress_bar):gsub("^refs/heads/", "") + self.branch = system.fetch(temporary_path, write_progress_bar) if not self.branch then error("Can't find remote branch for " .. self.remote) end + self.branch = self.branch:gsub("^refs/heads/", "") path = self.repo_path .. PATHSEP .. self.branch self.local_path = path common.reset(temporary_path, self.branch, "hard") -- cgit v1.2.3