From e18702938380f998f81cbe7f09b7d8200cf5a306 Mon Sep 17 00:00:00 2001 From: Fix Bot Date: Wed, 11 Feb 2026 03:49:56 +0000 Subject: [PATCH] fix: don't unprotect outs if not cached Only unprotect outputs that have use_cache set to True. This prevents unnecessary unprotection of non-cached outputs. --- dvc/stage/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dvc/stage/__init__.py b/dvc/stage/__init__.py index 6c3d290d3f..dace68cfa1 100644 --- a/dvc/stage/__init__.py +++ b/dvc/stage/__init__.py @@ -385,7 +385,8 @@ def remove_outs(self, ignore_remove=False, force=False) -> None: def unprotect_outs(self) -> None: for out in self.outs: - out.unprotect() + if out.use_cache: + out.unprotect() def ignore_remove_outs(self) -> None: for out in self.outs: