From 8b5ee7251ed7fc66e37e624a1cd306260af67896 Mon Sep 17 00:00:00 2001 From: Yoshiki Obinata Date: Fri, 14 Jul 2023 02:14:07 +0900 Subject: [PATCH] [jsk_robot_startup] use rev-list to check diverge --- .../jsk_robot_startup/scripts/update_workspace_main.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsk_robot_common/jsk_robot_startup/scripts/update_workspace_main.sh b/jsk_robot_common/jsk_robot_startup/scripts/update_workspace_main.sh index ab07bbdac2..63c381c888 100755 --- a/jsk_robot_common/jsk_robot_startup/scripts/update_workspace_main.sh +++ b/jsk_robot_common/jsk_robot_startup/scripts/update_workspace_main.sh @@ -100,7 +100,7 @@ if [ "${UPDATE_WORKSPACE}" == "true" ]; then ln -sf $ROSINSTALL $WORKSPACE/src/.rosinstall wstool update -t $WORKSPACE/src --delete-changed-uris # When the repository's Spec-Version branch has commits which are not pushed to remote, they are evacuated to another branch - wstool foreach -t $WORKSPACE/src --git --shell 'expected_version=$(wstool info . | grep Spec-Version: | awk '\''{print $2}'\''); current_version=$(git rev-parse --abbrev-ref HEAD); remote_diff=$(git diff --stat $current_version origin/$current_version); if [ "$expected_version" = "$current_version" ] && [ -n "$remote_diff" ]; then git checkout -b ${expected_version}-patch-$(date +%Y%m%d%H%M%S); git checkout origin/$expected_version; git branch -D $expected_version; git checkout -b $expected_version --track origin/$expected_version; fi' + wstool foreach -t $WORKSPACE/src --git --shell 'expected_version=$(wstool info . | grep Spec-Version: | awk '\''{print $2}'\''); current_version=$(git rev-parse --abbrev-ref HEAD); remote_diff_head_origin=$(git rev-list HEAD..origin); remote_diff_origin_head=$(git rev-list origin..HEAD); remote_diff="${remote_diff_head_origin}${remote_diff_origin_head}"; if [ "$expected_version" = "$current_version" ] && [ -n "$remote_diff" ]; then git checkout -b ${expected_version}-patch-$(date +%Y%m%d%H%M%S); git checkout origin/$expected_version; git branch -D $expected_version; git checkout -b $expected_version --track origin/$expected_version; fi' wstool update -t $WORKSPACE/src WSTOOL_UPDATE_RESULT=$? else