ruki 1 год назад
Родитель
Сommit
2b837d83db
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      scripts/autoupdate.lua

+ 2 - 1
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