diff options
author | Steven Whitman <ninloot@gmail.com> | 2019-02-01 15:03:37 -0500 |
---|---|---|
committer | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-07-06 11:20:23 +0800 |
commit | 41b9cea832ad5614df94c314d29d4b044aadce88 (patch) | |
tree | 6400fbcfa92b9a6c1da3712475ad30a7228d52f0 /git/test/test_repo.py | |
parent | 31cc0470115b2a0bab7c9d077902953a612bbba6 (diff) | |
download | gitpython-41b9cea832ad5614df94c314d29d4b044aadce88.tar.gz |
Add support to pass clone options that can be repeated multiple times
Diffstat (limited to 'git/test/test_repo.py')
-rw-r--r-- | git/test/test_repo.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/git/test/test_repo.py b/git/test/test_repo.py index 7fc49f3b..0577bd58 100644 --- a/git/test/test_repo.py +++ b/git/test/test_repo.py @@ -229,6 +229,22 @@ class TestRepo(TestBase): Repo.clone_from(original_repo.git_dir, pathlib.Path(rw_dir) / "clone_pathlib") + @with_rw_directory + def test_clone_from_pathlib_withConfig(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")) + + cloned = Repo.clone_from(original_repo.git_dir, pathlib.Path(rw_dir) / "clone_pathlib_withConfig", + multi_options=["--recurse-submodules=repo", + "--config core.filemode=false", + "--config submodule.repo.update=checkout"]) + + assert_equal(cloned.config_reader().get_value('submodule', 'active'), 'repo') + assert_equal(cloned.config_reader().get_value('core', 'filemode'), False) + assert_equal(cloned.config_reader().get_value('submodule "repo"', 'update'), 'checkout') + @with_rw_repo('HEAD') def test_max_chunk_size(self, repo): class TestOutputStream(object): |