X-Git-Url: https://gerrit.nordix.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=jjb%2Fopendev%2Fpush-upstream-jobs.sh;h=83c858d9901906946dc2bb7e80e3b86703200d3d;hb=refs%2Fchanges%2F05%2F1405%2F2;hp=02337646d468628ac2ae8243f96d8725030b06ea;hpb=c90ddaf974baf3f42849b74e869cfa22c775df33;p=infra%2Fcicd.git diff --git a/jjb/opendev/push-upstream-jobs.sh b/jjb/opendev/push-upstream-jobs.sh index 02337646..83c858d9 100755 --- a/jjb/opendev/push-upstream-jobs.sh +++ b/jjb/opendev/push-upstream-jobs.sh @@ -58,8 +58,13 @@ opendev_remote_url="ssh://$username@$opendev_gerrit_base/$opendev_project" # GERRIT_BRANCH is the _intended_ branch of the commit under review # E.g. git push HEAD:refs/for/master => GERRIT_BRANCH='master' -# GERRIT_TOPIC is the rest of the refspec after GERRIT_BRANCH -refspec="$commit_hash:refs/for/$GERRIT_BRANCH/$GERRIT_TOPIC" +# 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" +else + refspec="$commit_hash:refs/for/$GERRIT_BRANCH/$GERRIT_TOPIC" +fi echo >&2 "Pushing to OpenDev"