From ace27f78682090f0a3017e3583654b187f3705e6 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Wed, 23 Nov 2022 13:20:52 +0100 Subject: [PATCH] Fix default checkout --- scripts/utils/prepare.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/utils/prepare.sh b/scripts/utils/prepare.sh index 16668ca..44ceffa 100755 --- a/scripts/utils/prepare.sh +++ b/scripts/utils/prepare.sh @@ -18,7 +18,10 @@ alias git="git -C .build/repository" if ! [ -d .build/repository ]; then git clone "${GIT_REPOSITORY}" .build/repository else - git checkout - # Checkout previous branch in case GIT_CHECKOUT was different + # Checkout default-branch in case GIT_CHECKOUT was different + defaultBranch=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') + git checkout "${defaultBranch}" + git pull # Get changes fi