summaryrefslogtreecommitdiff
path: root/git/test/test_repo.py
diff options
context:
space:
mode:
authorMikuláš Poul <mikulaspoul@gmail.com>2017-10-07 12:23:46 +0200
committerMikuláš Poul <mikulaspoul@gmail.com>2017-10-07 12:23:46 +0200
commit4ee7e1a72aa2b9283223a8270a7aa9cb2cdb5ced (patch)
tree6153d0615b78096ec8b9950041c3ca900a51bcd8 /git/test/test_repo.py
parentf237620189a55d491b64cac4b5dc01b832cb3cbe (diff)
downloadgitpython-4ee7e1a72aa2b9283223a8270a7aa9cb2cdb5ced.tar.gz
Converting path in clone and clone_from to str before any other operation in case eg pathlib.Path is passed
Diffstat (limited to 'git/test/test_repo.py')
-rw-r--r--git/test/test_repo.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/git/test/test_repo.py b/git/test/test_repo.py
index 86fb2f51..2c3ad957 100644
--- a/git/test/test_repo.py
+++ b/git/test/test_repo.py
@@ -16,6 +16,11 @@ try:
except ImportError:
from unittest2 import skipIf, SkipTest
+try:
+ import pathlib
+except ImportError:
+ pathlib = None
+
from git import (
InvalidGitRepositoryError,
Repo,
@@ -210,6 +215,15 @@ class TestRepo(TestBase):
assert_equal(environment, cloned.git.environment())
+ @with_rw_directory
+ def test_clone_from_pathlib(self, rw_dir):
+ if pathlib is None: # pythons bellow 3.4 don't have pathlib
+ raise SkipTest("pathlib was introduced in 3.4")
+
+ original_repo = Repo.init(osp.join(rw_dir, "repo"))
+
+ Repo.clone_from(original_repo.git_dir, pathlib.Path(rw_dir) / "clone_pathlib")
+
def test_init(self):
prev_cwd = os.getcwd()
os.chdir(tempfile.gettempdir())