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:
parent
5ad56c346e
commit
dde1d73058
@ -56,29 +56,32 @@ EOF
|
|||||||
PROJECT_DIR=$(basename $PROJECT)
|
PROJECT_DIR=$(basename $PROJECT)
|
||||||
rm -rf $PROJECT_DIR
|
rm -rf $PROJECT_DIR
|
||||||
git clone ssh://$USERNAME@review.openstack.org:29418/$PROJECT.git
|
git clone ssh://$USERNAME@review.openstack.org:29418/$PROJECT.git
|
||||||
|
|
||||||
pushd $PROJECT_DIR
|
pushd $PROJECT_DIR
|
||||||
git checkout $BRANCH
|
|
||||||
git review -s
|
|
||||||
if [ -n "$change_id" ] ; then
|
|
||||||
git review -d $change_id
|
|
||||||
fi
|
|
||||||
popd
|
|
||||||
|
|
||||||
python update.py $PROJECT_DIR
|
# make sure the project even has this branch
|
||||||
|
if git branch -a | grep -q "^ remotes/origin/$BRANCH$" ; then
|
||||||
pushd $PROJECT_DIR
|
git checkout $BRANCH
|
||||||
if ! git diff --exit-code HEAD ; then
|
git review -s
|
||||||
# Commit and review
|
|
||||||
git_args="-a -F-"
|
|
||||||
if [ -n "$change_id" ] ; then
|
if [ -n "$change_id" ] ; then
|
||||||
git_args="--amend $git_args"
|
git review -d $change_id
|
||||||
fi
|
fi
|
||||||
git commit $git_args <<EOF
|
popd
|
||||||
|
|
||||||
|
python update.py $PROJECT_DIR
|
||||||
|
|
||||||
|
pushd $PROJECT_DIR
|
||||||
|
if ! git diff --exit-code HEAD ; then
|
||||||
|
# Commit and review
|
||||||
|
git_args="-a -F-"
|
||||||
|
if [ -n "$change_id" ] ; then
|
||||||
|
git_args="--amend $git_args"
|
||||||
|
fi
|
||||||
|
git commit $git_args <<EOF
|
||||||
$COMMIT_MSG
|
$COMMIT_MSG
|
||||||
EOF
|
EOF
|
||||||
git review -t $TOPIC $BRANCH
|
git review -t $TOPIC $BRANCH
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
popd
|
|
||||||
|
|
||||||
|
popd
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user