git-sync-web 自动提交 2026-09-08 17:31:52

This commit is contained in:
tamakyi
2026-09-08 17:31:52 +08:00
parent b16e589dd9
commit be99e73a0e
4 changed files with 60 additions and 10 deletions
+6
View File
@@ -72,6 +72,12 @@ func remoteRefExists(path, remote, branch string) bool {
return err == nil
}
// branchExists 检查本地分支是否存在
func branchExists(path, branch string) bool {
_, err := gitRun(path, 15*time.Second, "show-ref", "--verify", "-q", "refs/heads/"+branch)
return err == nil
}
func dirtyCount(path string) int {
out, err := gitRun(path, 30*time.Second, "status", "--porcelain")
if err != nil {