From: Stephen Haberman Date: Wed, 9 Jul 2008 08:41:08 +0000 (-0500) Subject: Install the stable hook sooner to see it work for the initial stable commit. X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a07c45c90954444da2b7bb781ef77daaebac360e;p=git-central.git Install the stable hook sooner to see it work for the initial stable commit. --- 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" &&