From 1a3e1102c66bd6cfbc1444871408cab9f15d6180 Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Tue, 30 Sep 2008 18:30:58 -0500 Subject: [PATCH] Let 0-commit stable branches move on. --- server/update-stable | 8 ++++++-- tests/t2102-server-update-stable-candidate.sh | 9 +++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/server/update-stable b/server/update-stable index 7caf865..e7688db 100644 --- a/server/update-stable +++ b/server/update-stable @@ -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 diff --git a/tests/t2102-server-update-stable-candidate.sh b/tests/t2102-server-update-stable-candidate.sh index b36dd1f..d07af4a 100644 --- a/tests/t2102-server-update-stable-candidate.sh +++ b/tests/t2102-server-update-stable-candidate.sh @@ -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 && -- 2.39.5