From 41b9cea832ad5614df94c314d29d4b044aadce88 Mon Sep 17 00:00:00 2001 From: Steven Whitman Date: Fri, 1 Feb 2019 15:03:37 -0500 Subject: Add support to pass clone options that can be repeated multiple times --- git/test/test_repo.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'git/test/test_repo.py') 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): -- cgit v1.2.1