From 7fa058293b5d35875db5e6d3b6175e0c46fedcd4 Mon Sep 17 00:00:00 2001 From: Nikolaos Karaolidis Date: Sun, 16 Feb 2025 15:36:30 +0000 Subject: [PATCH] Update update script Signed-off-by: Nikolaos Karaolidis --- lib/scripts/update.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/scripts/update.sh b/lib/scripts/update.sh index 4bd680a..daf7af8 100755 --- a/lib/scripts/update.sh +++ b/lib/scripts/update.sh @@ -16,14 +16,16 @@ for path in ${paths}; do echo "Processing submodule: ${path}" cd "${path}" || exit - git checkout master - git fetch upstream - git merge upstream/master - branches=$(git for-each-ref --format='%(refname:short)' refs/heads/ | grep -v '^master$') + default_branch=$(git remote show origin | awk '/HEAD branch/ {print $NF}') + git checkout "${default_branch}" + git fetch upstream + git merge "upstream/${default_branch}" + + branches=$(git for-each-ref --format='%(refname:short)' refs/heads/ | grep -v "^${default_branch}$") for branch in ${branches}; do git checkout "${branch}" - git rebase master + git rebase "${default_branch}" done git checkout integration