From dc1916d9a1d2613f3243e32c1cc494d56d7af998 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 6 Feb 2020 22:49:06 +0000 Subject: [PATCH] build.sh: Set the correct branch name This is later used in the build to mark the build. Signed-off-by: Michael Tremer --- build.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.sh b/build.sh index b17b958..231e1a7 100755 --- a/build.sh +++ b/build.sh @@ -58,6 +58,11 @@ build() { local commit_new="$(git rev-parse origin/${branch})" [ "${commit_old}" = "${commit_new}" ] && return 2 + local current_branch="$(git rev-parse --abbrev-ref HEAD)" + if [ "${current_branch}" != "${branch}" ]; then + git checkout -b "${branch}" "${commit_new}" + fi + # Checkout the latest commit git reset --hard "${commit_new}" -- 2.47.3