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

This commit is contained in:
tamakyi
2026-09-08 17:33:08 +08:00
parent be99e73a0e
commit 18dbd34f2c
3 changed files with 15 additions and 0 deletions
+7
View File
@@ -594,6 +594,13 @@ func (e *Engine) syncOnce(s *repoState, trigger string) {
s.mu.Unlock()
e.pushStatus(s)
if ahead > 0 && (cfg.Mode == "push" || cfg.Mode == "both") {
if !e.pushAll(s, cfg, ahead) {
// 推送失败,本轮终止,避免继续拉取加剧分叉
e.setFail(s, "推送失败,本轮同步已终止(跳过拉取以避免分叉加剧)")
return
}
}
if behind > 0 && (cfg.Mode == "pull" || cfg.Mode == "both") {
if !e.pullRemote(s, cfg, remote, behind) {
return