From fd74c42e543748b5bbfcde23080cdbc745cfdea6 Mon Sep 17 00:00:00 2001 From: Sharpe <2106314+justinsharpe@users.noreply.github.com> Date: Sat, 10 Oct 2026 06:58:07 -0400 Subject: [PATCH] =?UTF-8?q?test(scratch):=20os.utime=20follow=5Fsymlinks?= =?UTF-8?q?=20is=20POSIX-only=20=E2=80=94=20guard=20it=20so=20the=20worktr?= =?UTF-8?q?ee=20test=20can=20age=20its=20tree=20on=20Windows=20too?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_scratch_dir.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_scratch_dir.py b/tests/test_scratch_dir.py index d4cce2e7c5..cae2076c80 100644 --- a/tests/test_scratch_dir.py +++ b/tests/test_scratch_dir.py @@ -381,7 +381,11 @@ def test_prune_releases_git_worktree_registration_of_idle_entry(tmp_path): ancient = time.time() - 30 * 3600 for dirpath, dirnames, filenames in os.walk(tree.parent): for name in dirnames + filenames: - os.utime(os.path.join(dirpath, name), (ancient, ancient), follow_symlinks=False) + try: + os.utime(os.path.join(dirpath, name), (ancient, ancient), follow_symlinks=False) + except NotImplementedError: + # Windows: os.utime has no follow_symlinks parameter. + os.utime(os.path.join(dirpath, name), (ancient, ancient)) os.utime(tree.parent, (ancient, ancient)) assert prune_scratch_dir(scratch) == 1 listing = subprocess.run(["git", "worktree", "list", "--porcelain"], cwd=repo, capture_output=True,