Fix typo in gerrit-git-prep.

Print the triggering URL.

Change-Id: Id257518e91c6212c971306f2c472fb36b128583a
This commit is contained in:
James E. Blair 2012-05-30 13:09:35 -07:00
parent 55570cf7e6
commit 1db21187dd

View File

@ -17,12 +17,24 @@ then
exit 1
fi
if [ -z "$GERRIT_NEWREV" ] && [ -z "$GERRIT_REFSPEC" ] && [ -z "$GERRIT_CHANGES"]
if [ -z "$GERRIT_NEWREV" ] && [ -z "$GERRIT_REFSPEC" ] && [ -z "$GERRIT_CHANGES" ]
then
echo "This job may only be triggered by Gerrit."
exit 1
fi
if [ ! -z "$GERRIT_CHANGES" ]
then
CHANGE_NUMBER=`echo $GERRIT_CHANGES|grep -Po ".*/\K\d+(?=/\d+)"`
echo "Triggered by: https://$SITE/$CHANGE_NUMBER"
fi
if [ ! -z "$GERRIT_REFSPEC" ]
then
CHANGE_NUMBER=`echo $GERRIT_REFSPEC|grep -Po ".*/\K\d+(?=/\d+)"`
echo "Triggered by: https://$SITE/$CHANGE_NUMBER"
fi
function merge_change {
PROJECT=$1
REFSPEC=$2