X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=server%2Fupdate-stable;h=c816750af5c70225d2ce307d66ca0eb878d37739;hb=755a38971304938a8b0e16795894a2025479b597;hp=6e1264b0aa7841662539a3efe31f91fe1ede6f25;hpb=de43e767b432475a73f2b29bf29678914c285e9a;p=git-central.git diff --git a/server/update-stable b/server/update-stable index 6e1264b..c816750 100644 --- a/server/update-stable +++ b/server/update-stable @@ -60,11 +60,39 @@ case "$refname" in ;; 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 fi +# The tip must always be new +already=$(git branch --contains "$newrev") +if [ "$already" != "" ] ; then + already=${already## } + echo "----------------------------------------------------" + echo + echo "$short_refname is already referred to by $already" + echo + echo "----------------------------------------------------" + exit 1 +fi + if [ "$short_refname" == "stable" ] ; then # Stable enforcement