From e212b6f56f73f3038a4fcfd7921528cb8335a25b Mon Sep 17 00:00:00 2001 From: Patrik Lundin Date: Tue, 31 Jan 2023 08:19:41 +0100 Subject: [PATCH] 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. ``` --- global/post-tasks.d/018packages | 2 ++ 1 file changed, 2 insertions(+) diff --git a/global/post-tasks.d/018packages b/global/post-tasks.d/018packages index a48efbe..39569b2 100755 --- a/global/post-tasks.d/018packages +++ b/global/post-tasks.d/018packages @@ -42,6 +42,8 @@ if [ -f $CONFIG -o $LOCALCONFIG ]; then if [ "$src" != "$(git config remote.origin.url)" ]; then git config remote.origin.url $src 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 git pull -q || (git fetch && git reset --hard) else