diff options
| author | Greg <supahgreg@users.noreply.github.com> | 2025-10-08 11:43:59 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-08 11:43:59 -0500 |
| commit | 9d200d988e85f1a0d273fb2b8a9f43666887c661 (patch) | |
| tree | 7db73c706939a629759d25bd43b74cf110b07dab | |
| parent | bb1fd07149bd72afc953528a5b7d996678c06361 (diff) | |
| parent | b709a73e34dcf0ee280fa32092e9b3715e757645 (diff) | |
Merge pull request #16 from tt-rss/bugfix/legacy-git-remote-but-main
Also migrate 'official' plugins that are from the old site but are using 'main'
| -rw-r--r-- | .docker/app/startup.sh | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/.docker/app/startup.sh b/.docker/app/startup.sh index df730c336..64111dd19 100644 --- a/.docker/app/startup.sh +++ b/.docker/app/startup.sh @@ -102,16 +102,26 @@ if [ -z "$TTRSS_NO_STARTUP_PLUGIN_UPDATES" ]; then esac if [ -n "$NEW_ORIGIN_URL" ]; then - if [ $(sudo -u app git branch --show-current) = "master" ]; then - echo "Migrating origin remote from ${ORIGIN_URL} to ${NEW_ORIGIN_URL}" - sudo -u app git remote set-url origin "$NEW_ORIGIN_URL" - sudo -u app git branch -m master main - sudo -u app git fetch origin - sudo -u app git branch --set-upstream-to origin/main main - sudo -u app git remote set-head origin --auto - else - echo "Skipping migration of origin remote from ${ORIGIN_URL} to ${NEW_ORIGIN_URL} (local branch is not 'master')" - fi + case $(sudo -u app git branch --show-current) in + master) + echo "Migrating origin remote from ${ORIGIN_URL} to ${NEW_ORIGIN_URL} (and switching the branch from 'master' to 'main')" + sudo -u app git remote set-url origin "$NEW_ORIGIN_URL" + sudo -u app git branch -m master main + sudo -u app git fetch origin + sudo -u app git branch --set-upstream-to origin/main main + sudo -u app git remote set-head origin --auto + ;; + main) + echo "Migrating origin remote from ${ORIGIN_URL} to ${NEW_ORIGIN_URL}" + sudo -u app git remote set-url origin "$NEW_ORIGIN_URL" + sudo -u app git fetch origin + sudo -u app git branch --set-upstream-to origin/main main + sudo -u app git remote set-head origin --auto + ;; + *) + echo "Skipping migration of origin remote from ${ORIGIN_URL} to ${NEW_ORIGIN_URL} (local branch is not 'master' or 'main')" + ;; + esac fi fi |