;;
esac
+if [ "$change_type" == "delete" ] ; then
+ exit 0
+fi
+
+if [ "$change_type" == "create" -a "$short_refname" != "stable" ] ; then
+ not_on_stable=$(git rev-list stable..$newrev)
+ if [ "$not_on_stable" == "" ] ; then
+ echo "----------------------------------------------------"
+ echo
+ echo "Creating a branch must include new commits"
+ echo
+ echo "----------------------------------------------------"
+ exit 1
+ fi
+fi
+
# create/delete is okay
if [ "$change_type" != "update" ] ; then
exit 0
cat push.err | grep "topic1 has been merged into stable"
'
+test_expect_success 'topic3 cannot initially be created on stable' '
+ git checkout -b topic3 stable &&
+ ! git push origin topic3 2>push.err &&
+ cat push.err | grep "Creating a branch must include new commits"
+'
+
test_done