◐ 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
2 changes: 2 additions & 0 deletions test/test_clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def test_clone_unsafe_options(self, rw_repo):

unsafe_options = [
{"upload-pack": f"touch {tmp_file}"},
{"u": f"touch {tmp_file}"},
{"config": "protocol.ext.allow=always"},
{"c": "protocol.ext.allow=always"},
Expand Down @@ -216,6 +217,7 @@ def test_clone_from_unsafe_options(self, rw_repo):

unsafe_options = [
{"upload-pack": f"touch {tmp_file}"},
{"u": f"touch {tmp_file}"},
{"config": "protocol.ext.allow=always"},
{"c": "protocol.ext.allow=always"},
Expand Down
18 changes: 8 additions & 10 deletions test/test_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ def test_fetch_unsafe_options(self, rw_repo):
remote = rw_repo.remote("origin")
tmp_dir = Path(tdir)
tmp_file = tmp_dir / "pwn"
unsafe_options = [{"upload-pack": f"touch {tmp_file}"}]
for unsafe_option in unsafe_options:
with self.assertRaises(UnsafeOptionError):
remote.fetch(**unsafe_option)
Expand Down Expand Up @@ -895,7 +895,7 @@ def test_pull_unsafe_options(self, rw_repo):
remote = rw_repo.remote("origin")
tmp_dir = Path(tdir)
tmp_file = tmp_dir / "pwn"
unsafe_options = [{"upload-pack": f"touch {tmp_file}"}]
for unsafe_option in unsafe_options:
with self.assertRaises(UnsafeOptionError):
remote.pull(**unsafe_option)
Expand Down Expand Up @@ -964,10 +964,9 @@ def test_push_unsafe_options(self, rw_repo):
tmp_dir = Path(tdir)
tmp_file = tmp_dir / "pwn"
unsafe_options = [
{
"receive-pack": f"touch {tmp_file}",
"exec": f"touch {tmp_file}",
}
]
for unsafe_option in unsafe_options:
assert not tmp_file.exists()
Expand All @@ -991,10 +990,9 @@ def test_push_unsafe_options_allowed(self, rw_repo):
tmp_dir = Path(tdir)
tmp_file = tmp_dir / "pwn"
unsafe_options = [
{
"receive-pack": f"touch {tmp_file}",
"exec": f"touch {tmp_file}",
}
]
for unsafe_option in unsafe_options:
# The options will be allowed, but the command will fail.
Expand Down
Loading
Toggle all file notes Toggle all file annotations