# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
##############################################################################
+echo "---> gerrit-fetch-dependencies.sh"
# Fetches patches all projects provided by comment trigger
#
# Takes a list of Gerrit patches and fetches all projects and cherry-pick
# End git-review workaround
projects=()
-for patch in $(echo "${PATCHES[@]}"); do
+for patch in "${PATCHES[@]}"; do
json=$(curl -s "$GERRIT_URL/changes/$patch" | sed -e "s/)]}'//")
project=$(echo "$json" | jq -r '.project')
branch=$(echo "$json" | jq -r '.branch')