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