Install the stable hook sooner to see it work for the initial stable commit.
authorStephen Haberman <stephen@exigencecorp.com>
Wed, 9 Jul 2008 08:41:08 +0000 (03:41 -0500)
committerStephen Haberman <stephen@exigencecorp.com>
Wed, 9 Jul 2008 08:41:08 +0000 (03:41 -0500)
tests/t2100-server-update-stable.sh

index 9143008..0961b99 100644 (file)
@@ -5,21 +5,29 @@ test_description='server update stable enforcer'
 . ./test-lib.sh
 
 test_expect_success 'setup' '
-       echo This is a test. >a &&
+       echo setup >a &&
        git add a &&
        git commit -m "a" &&
        git clone ./. server &&
-       rm -fr server/.git/hooks &&
-       git checkout -b stable &&
        git remote add origin ./server &&
-       git push origin stable &&
-       git config --add branch.stable.remote origin &&
-       git config --add branch.stable.merge refs/heads/stable
+       rm -fr server/.git/hooks
 '
 
 # setup the update hook
 install_server_hook 'update-stable' 'update'
 
+test_expect_success 'initial stable commit works', '
+       # do one stable-less commit
+       echo $test_name >a &&
+       git commit -a -m "$test_name" &&
+       git push origin master &&
+
+       git checkout -b stable &&
+       git push origin stable &&
+       git config --add branch.stable.remote origin &&
+       git config --add branch.stable.merge refs/heads/stable
+'
+
 test_expect_success 'reject commit directly to stable' '
        echo $test_name >a &&
        git commit -a -m "$test_name going onto stable" &&