Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit b77ae99

Browse files
committed
fix(api/tracking): ingore symlinks
1 parent 999650e commit b77ae99

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

api/outdated/outdated/tests/test_tracking.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from pathlib import Path
12
from unittest.mock import PropertyMock, call
23

34
import pytest
@@ -283,6 +284,16 @@ def test_lockfiles(db, project, tmp_repo_root, exists):
283284
assert not exists
284285

285286

287+
def test_lockfiles_ignore_symlinks(db, project, tmp_repo_root):
288+
tracker = Tracker(project)
289+
tracker.local_path.mkdir(parents=True, exist_ok=False)
290+
291+
lockfiles = tracker.lockfiles
292+
assert lockfiles == []
293+
(tracker.local_path / "yarn.lock").symlink_to(Path("/proc/1/environ"))
294+
assert tracker.lockfiles == []
295+
296+
286297
@pytest.mark.django_db()
287298
def test_delete(tmp_repo_root, project_factory):
288299
project = project_factory(repo="my.git.com/foo/bar")

api/outdated/outdated/tracking.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@ def lockfiles(self):
8585
if ".git" in dirs:
8686
dirs.remove(".git")
8787

88-
lockfile_list.extend([Path(root).joinpath(file) for file in files])
88+
lockfile_list.extend(
89+
[
90+
Path(root).joinpath(file)
91+
for file in files
92+
if not Path(root).joinpath(file).is_symlink()
93+
]
94+
)
8995

9096
return lockfile_list
9197

0 commit comments

Comments
 (0)