]> git.droids-corp.org - git-central.git/commitdiff
Let 0-commit stable branches move on.
authorStephen Haberman <stephen@exigencecorp.com>
Tue, 30 Sep 2008 23:30:58 +0000 (18:30 -0500)
committerStephen Haberman <stephen@exigencecorp.com>
Tue, 30 Sep 2008 23:30:58 +0000 (18:30 -0500)
server/update-stable
tests/t2102-server-update-stable-candidate.sh

index 7caf8651fced7b400cd7901be5c909f03ad41c0e..e7688db70b7d574d6c36af0f797f6e23fd12e41d 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
 
index b36dd1f9cb9a863ec8d63ecc5058e76644ffab87..d07af4aefee11103290dbd53b74e21c0c1b618c5 100644 (file)
@@ -48,6 +48,15 @@ test_expect_success 'create candidate1' '
        git push origin candidate1
 '
 
+test_expect_success '0-commit branches are not caught by future stable' '
+       git checkout -b topic4 stable &&
+       git push origin topic4 &&
+
+       echo "$test_name" > a &&
+       git commit -a -m "$test_name" &&
+       git push origin topic4
+'
+
 test_expect_success 'topic1 cannot be changed' '
        git checkout topic1 &&
        echo "$test_name" >a.topic1 &&