diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-07-07 23:02:25 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-07-07 23:45:47 +0200 |
commit | b425301ad16f265157abdaf47f7af1c1ea879068 (patch) | |
tree | 22eef12f33cec4cff9ef12e39a59ce32351b2bf1 /test/git/test_repo.py | |
parent | ca288d443f4fc9d790eecb6e1cdf82b6cdd8dc0d (diff) | |
download | gitpython-b425301ad16f265157abdaf47f7af1c1ea879068.tar.gz |
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
Diffstat (limited to 'test/git/test_repo.py')
-rw-r--r-- | test/git/test_repo.py | 16 |
1 files changed, 15 insertions, 1 deletions
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 |