We use caddy-server and caddy-git plugin to host our websites.
When our deploy branch changed in our github repo from gh-pages to deploy-master we noticed that caddy-git was unable to update a site when the config change indicated a change in branch name.
The core problem was that the deployed repo folder was missing the branch from the remote origin
Solution
In the event of a failure to update a branch this PR adds a case and validates if the update failed due to a change in branch name and if so we fetch the remote and try to switch the branch to the config.
This would ensure the caddy service would not break.
Problem Statement
We use
caddy-server
andcaddy-git
plugin to host our websites. When our deploy branch changed in ourgithub
repo fromgh-pages
todeploy-master
we noticed thatcaddy-git
was unable to update a site when the config change indicated a change in branch name.The core problem was that the deployed repo folder was missing the branch from the remote origin
Solution
In the event of a failure to update a branch this PR adds a case and validates if the update failed due to a change in branch name and if so we fetch the remote and try to switch the branch to the config. This would ensure the caddy service would not break.