◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
4 changes: 2 additions & 2 deletions git/repo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1386,8 +1386,8 @@ def _clone(
Git.check_unsafe_protocols(url)
if not allow_unsafe_options:
Git.check_unsafe_options(options=list(kwargs.keys()), unsafe_options=cls.unsafe_git_clone_options)
if not allow_unsafe_options and multi_options:
Git.check_unsafe_options(options=multi_options, unsafe_options=cls.unsafe_git_clone_options)

proc = git.clone(
multi,
Expand Down
18 changes: 18 additions & 0 deletions test/test_clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@ def test_clone_unsafe_options(self, rw_repo):
rw_repo.clone(tmp_dir, **unsafe_option)
assert not tmp_file.exists()

@pytest.mark.xfail(
sys.platform == "win32",
reason=(
Expand Down Expand Up @@ -216,6 +225,15 @@ def test_clone_from_unsafe_options(self, rw_repo):
Repo.clone_from(rw_repo.working_dir, tmp_dir, **unsafe_option)
assert not tmp_file.exists()

@pytest.mark.xfail(
sys.platform == "win32",
reason=(
Expand Down
11 changes: 11 additions & 0 deletions test/test_submodule.py
Original file line number Diff line number Diff line change
@@ -1332,6 +1332,17 @@ def test_submodule_update_unsafe_options(self, rw_repo):
submodule.update(clone_multi_options=[unsafe_option])
assert not tmp_file.exists()

@with_rw_repo("HEAD")
def test_submodule_update_unsafe_options_allowed(self, rw_repo):
with tempfile.TemporaryDirectory() as tdir:
Expand Down
Loading
Toggle all file notes Toggle all file annotations