try remove branch

pull/3071/head
ruki 1 year ago
parent 7d0925f479
commit 2b837d83db
  1. 3
      scripts/autoupdate.lua

@ -42,7 +42,7 @@ function _update_version(instance, version, shasum)
local branch_current = os.iorun("git branch --show-current"):trim() local branch_current = os.iorun("git branch --show-current"):trim()
local repourl = "https://github.com/xmake-io/xmake-repo.git" local repourl = "https://github.com/xmake-io/xmake-repo.git"
os.vexec("git reset --hard HEAD") os.vexec("git reset --hard HEAD")
os.vexec("git branch -D %s", branch) os.execv("git", {"branch", "-D", branch}, {try = true})
os.vexec("git checkout dev") os.vexec("git checkout dev")
os.vexec("git pull %s dev", repourl) os.vexec("git pull %s dev", repourl)
os.vexec("git branch %s", branch) os.vexec("git branch %s", branch)
@ -51,6 +51,7 @@ function _update_version(instance, version, shasum)
local remote_branches = os.iorun("git ls-remote --head %s", repourl) local remote_branches = os.iorun("git ls-remote --head %s", repourl)
if remote_branches then if remote_branches then
for _, remote_branch in ipairs(remote_branches:split("\n")) do for _, remote_branch in ipairs(remote_branches:split("\n")) do
remote_branch = remote_branch:split("%s")[2]
if remote_branch == "refs/heads/" .. branch then if remote_branch == "refs/heads/" .. branch then
is_pending = true is_pending = true
break break

Loading…
Cancel
Save