diff --git a/docker/gitPush.sh b/docker/gitPush.sh index 96b1ca5..5b6d29d 100644 --- a/docker/gitPush.sh +++ b/docker/gitPush.sh @@ -12,6 +12,15 @@ if [ ! -d "$REPO_DIR/.git" ]; then fi cd "$REPO_DIR" + +# Abort previous rebase/cherry-pick if stuck +git rebase --abort 2>/dev/null || true +git cherry-pick --abort 2>/dev/null || true + +# Make sure we're on a clean 'main' +git checkout main || git checkout -b main origin/main +git pull --rebase --autostash + git remote set-url origin "https://${GITEA_TOKEN}@${GITURL}/${GITREPOPATH}" @@ -25,7 +34,7 @@ git add MirrorListV4 MirrorListV6 OPNS_MirrorListV4 OPNS_MirrorListV6 if ! git diff --quiet --cached; then echo "[$(date)] Committing and pushing changes..." git commit -m "Auto-update mirror list on $(date -Iseconds)" - git pull --rebase --autostash + # git pull --rebase --autostash git push --quiet echo "[$(date)] Changes pushed." else