Support master branch being renamed to main
Fixes: ``` 70run-post-tasks: invoking /var/cache/cosmos/model/post-tasks.d/018packages Your configuration specifies to merge with the ref 'refs/heads/master' from the remote, but no such ref was fetched. ```
This commit is contained in:
parent
4601e0bf08
commit
e212b6f56f
|
@ -42,6 +42,8 @@ if [ -f $CONFIG -o $LOCALCONFIG ]; then
|
||||||
if [ "$src" != "$(git config remote.origin.url)" ]; then
|
if [ "$src" != "$(git config remote.origin.url)" ]; then
|
||||||
git config remote.origin.url $src
|
git config remote.origin.url $src
|
||||||
fi
|
fi
|
||||||
|
# Support master branch being renamed to main
|
||||||
|
git branch --all | grep -q '^[[:space:]]*remotes/origin/main$' && git checkout main
|
||||||
# Update repo and clean out any local inconsistencies
|
# Update repo and clean out any local inconsistencies
|
||||||
git pull -q || (git fetch && git reset --hard)
|
git pull -q || (git fetch && git reset --hard)
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue