From b425301ad16f265157abdaf47f7af1c1ea879068 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Wed, 7 Jul 2010 23:02:25 +0200 Subject: Adjusted clone method to allow static classmethod clone ( using clone_from ) as well as the previous instance method clone to keep it compatible Fixed small bug in test code --- test/git/test_repo.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'test/git/test_repo.py') diff --git a/test/git/test_repo.py b/test/git/test_repo.py index 53829556..88d8c8c1 100644 --- a/test/git/test_repo.py +++ b/test/git/test_repo.py @@ -145,6 +145,19 @@ class TestRepo(TestBase): rc = r.clone(clone_path) self._assert_empty_repo(rc) + + try: + shutil.rmtree(clone_path) + except OSError: + # when relative paths are used, the clone may actually be inside + # of the parent directory + pass + # END exception handling + + # try again, this time with the absolute version + rc = Repo.clone_from(r.git_dir, clone_path) + self._assert_empty_repo(rc) + shutil.rmtree(git_dir_abs) try: shutil.rmtree(clone_path) @@ -153,6 +166,7 @@ class TestRepo(TestBase): # of the parent directory pass # END exception handling + # END for each path os.makedirs(git_dir_rela) @@ -441,7 +455,7 @@ class TestRepo(TestBase): for pn, parent in enumerate(obj.parents): rev = name + "^%i" % (pn+1) assert rev_parse(rev) == parent - self._assert_rev_parse_types(rev, obj2) + self._assert_rev_parse_types(rev, parent) # END for each parent return orig_obj -- cgit v1.2.1