FIX: Handling of git topic when push upstream
[infra/cicd.git] / jjb / acumos / push-upstream-jobs.sh
index 9354bfbbf1d0bf27d930ed4fb2bf9251a04e73f7..2aed5974029f3691869aca56d56f3171385d88b2 100755 (executable)
@@ -58,9 +58,9 @@ acumos_remote_url="ssh://$username@$acumos_gerrit_base/$acumos_project"
 # GERRIT_TOPIC is the rest of the refspec after GERRIT_BRANCH when the topic
 # is set for the change.
 if [ -z "${GERRIT_TOPIC:-}" ] ; then
-    refspec="$commit_hash:refs/for/$GERRIT_BRANCH"
+    refspec="${commit_hash}:refs/for/${GERRIT_BRANCH}"
 else
-    refspec="$commit_hash:refs/for/$GERRIT_BRANCH/$GERRIT_TOPIC"
+    refspec="${commit_hash}:refs/for/${GERRIT_BRANCH}%topic=${GERRIT_TOPIC}"
 fi
 
 echo >&2 "Pushing to Acumos"