From 1241a651c63a4044da4178cb66c7a4db9b310bbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Fri, 10 Dec 2021 12:44:13 +0100 Subject: [PATCH] Updated services-to-master script --- services-to-master.sh | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/services-to-master.sh b/services-to-master.sh index 5fcddb623..9eed05c38 100755 --- a/services-to-master.sh +++ b/services-to-master.sh @@ -28,30 +28,25 @@ function get_upstream_name { function pull_latest_commit { local SUBMODULE_NAME=$0 - echo "Pulling latest commit for: $SUBMODULE_NAME" - echo "$SUBMODULE_NAME: Checking which branch is the upstream branch" + echo "" + echo "$SUBMODULE_NAME" local BRANCH_NAME=$(get_upstream_branch) - - echo "$SUBMODULE_NAME: Upstream branch is $BRANCH_NAME" - - git checkout $BRANCH_NAME; - local REMOTE_NAME=$(get_upstream_name) - git pull $REMOTE_NAME $BRANCH_NAME; - echo "$SUBMODULE_NAME: Successfully pulled latest commit" - echo "" + echo "git fetch $REMOTE_NAME && git checkout $REMOTE_NAME/$BRANCH_NAME ..." + git fetch $REMOTE_NAME; + git checkout $REMOTE_NAME/$BRANCH_NAME; } export -f pull_latest_commit export -f get_upstream_branch export -f get_upstream_name -git submodule update --init git submodule foreach -q --recursive "bash -c pull_latest_commit \$name" -echo "Successfully pulled latest commits for every submodule!" +echo "" +echo "Successfully updated all submodules to latest commit." # Old command, if we need to checkout another branch than master or main: # git submodule foreach -q --recursive