summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorClaude <noreply@anthropic.com>2026-10-21 05:32:10 +0000
committerClaude <noreply@anthropic.com>2026-10-21 05:32:10 +0000
commit2de59fe9d850775f9f516180d144becd4db2c3da (patch)
treee9163be9dd9df3ee991d33a0b2084061d3e504c1 /plugins
parent06d5a3f8e838c81680838aec3266b0ec4c50f992 (diff)
security-guidance: make one nested repository test work on Windowsmhegazy/sg-index-copy-gitlinks
The test deleted a repository with shutil.rmtree, which fails on git's read-only object files there. It moves the directory away instead.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/security-guidance/tests/test_nested_repos.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/security-guidance/tests/test_nested_repos.py b/plugins/security-guidance/tests/test_nested_repos.py
index 574e5ef2..3c93a580 100644
--- a/plugins/security-guidance/tests/test_nested_repos.py
+++ b/plugins/security-guidance/tests/test_nested_repos.py
@@ -321,8 +321,8 @@ def test_untracked_file_name_is_not_read_as_a_pattern(outer, git_env):
def test_gitlink_without_a_repository_stays_in_the_copy(outer, marker, git_env):
"""A submodule that is not checked out: an empty directory."""
nested = _record_nested_repo(outer, marker)
- import shutil
- shutil.rmtree(nested)
+ # Moved, not deleted: git's object files are read-only on Windows.
+ nested.rename(outer.parent / "moved-away")
nested.mkdir()
(outer / "app.py").write_text(VULN_PY)