summaryrefslogtreecommitdiff
path: root/test/testlib/helper.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-11-04 20:09:19 +0100
committerSebastian Thiel <byronimo@gmail.com>2009-11-04 20:12:22 +0100
commitec1f9c9e9a6ce14ddc69b6be65188b3438f31f23 (patch)
treecea4ab324046c27c9a6e3570f11425053846af2b /test/testlib/helper.py
parentd884adc80c80300b4cc05321494713904ef1df2d (diff)
downloadgitpython-ec1f9c9e9a6ce14ddc69b6be65188b3438f31f23.tar.gz
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
Diffstat (limited to 'test/testlib/helper.py')
-rw-r--r--test/testlib/helper.py8
1 files changed, 6 insertions, 2 deletions
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