From a07c45c90954444da2b7bb781ef77daaebac360e Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Wed, 9 Jul 2008 03:41:08 -0500 Subject: [PATCH] Install the stable hook sooner to see it work for the initial stable commit. --- tests/t2100-server-update-stable.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/t2100-server-update-stable.sh b/tests/t2100-server-update-stable.sh index 9143008..0961b99 100644 --- a/tests/t2100-server-update-stable.sh +++ b/tests/t2100-server-update-stable.sh @@ -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" && -- 2.39.5