From ec1f9c9e9a6ce14ddc69b6be65188b3438f31f23 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Wed, 4 Nov 2009 20:09:19 +0100 Subject: helpers: fixed and improved test repo decorators to use the new head.checkout functions for greater ease of use - they work exactly as expected now. Fixed failing test in remote tests by actually removing the line --- test/testlib/helper.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test/testlib/helper.py') diff --git a/test/testlib/helper.py b/test/testlib/helper.py index 081299be..4ab7207d 100644 --- a/test/testlib/helper.py +++ b/test/testlib/helper.py @@ -100,7 +100,10 @@ def with_rw_repo(working_tree_ref): def repo_creator(self): repo_dir = tempfile.mktemp("non_bare_repo") rw_repo = self.rorepo.clone(repo_dir, shared=True, bare=False, n=True) - rw_repo.git.checkout("-b", "master", working_tree_ref) + + rw_repo.head.commit = working_tree_ref + rw_repo.head.reference.checkout() + try: return func(self, rw_repo) finally: @@ -141,7 +144,8 @@ def with_rw_and_rw_remote_repo(working_tree_ref): rw_remote_repo = self.rorepo.clone(remote_repo_dir, shared=True, bare=True) rw_repo = rw_remote_repo.clone(repo_dir, shared=True, bare=False, n=True) # recursive alternates info ? - rw_repo.git.checkout("-b", "master", working_tree_ref) + rw_repo.head.commit = working_tree_ref + rw_repo.head.reference.checkout() # prepare for git-daemon rw_remote_repo.daemon_export = True -- cgit v1.2.1