Check that the target branch exists

* propose_requirements_update.sh: Look before we leap. Don't descend
into the project repository and try to check out a branch without
first making sure it exists on the origin.

Change-Id: Ib4de5bdf8bf5cf134e3307755617456f282d790d
This commit is contained in:
Jeremy Stanley 2013-12-11 16:32:11 +00:00
parent 5ad56c346e
commit dde1d73058

View File

@ -56,8 +56,10 @@ EOF
PROJECT_DIR=$(basename $PROJECT)
rm -rf $PROJECT_DIR
git clone ssh://$USERNAME@review.openstack.org:29418/$PROJECT.git
pushd $PROJECT_DIR
# make sure the project even has this branch
if git branch -a | grep -q "^ remotes/origin/$BRANCH$" ; then
git checkout $BRANCH
git review -s
if [ -n "$change_id" ] ; then
@ -79,6 +81,7 @@ $COMMIT_MSG
EOF
git review -t $TOPIC $BRANCH
fi
popd
fi
popd
done