summaryrefslogtreecommitdiff
path: root/test/git/test_repo.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-07-07 23:02:25 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-07-07 23:45:47 +0200
commitb425301ad16f265157abdaf47f7af1c1ea879068 (patch)
tree22eef12f33cec4cff9ef12e39a59ce32351b2bf1 /test/git/test_repo.py
parentca288d443f4fc9d790eecb6e1cdf82b6cdd8dc0d (diff)
downloadgitpython-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.py16
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