Let 0-commit stable branches move on.
[git-central.git] / server / update-stable
index 7caf865..e7688db 100644 (file)
@@ -124,8 +124,12 @@ else
        # Check if topic is already in candidates
        candidate=$(git branch --contains "$oldrev" | grep -oP "candidate.*" --max-count=1)
        if [ $? -eq 0 ] ; then
-               display_error_message "$short_refname has been merged into $candidate"
-               exit 1
+               # Okay, it's in stable...but was it previously just a 0-commit initial banch?
+               git rev-list --first-parent stable | grep --quiet "$oldrev"
+               if [ $? -ne 0 ] ; then
+                       display_error_message "$short_refname has been merged into $candidate"
+                       exit 1
+               fi
        fi
 fi