From 4ff91e440a32807b62fbc42ad7741614e0879b80 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 17:08:00 +0000 Subject: [PATCH 1/4] Initial plan From 6dfbe8f3384187d4195ef7c7225be26b7a1518d7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 17:12:37 +0000 Subject: [PATCH 2/4] Add error checking for rename() calls in DevPullCommand Co-authored-by: sak0a <24781653+sak0a@users.noreply.github.com> --- src/Console/Commands/DevPullCommand.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Console/Commands/DevPullCommand.php b/src/Console/Commands/DevPullCommand.php index 370585d8..2907a793 100644 --- a/src/Console/Commands/DevPullCommand.php +++ b/src/Console/Commands/DevPullCommand.php @@ -272,7 +272,12 @@ private function replaceVendorFiles(string $noturRoot, string $sourcePath): void if (!is_dir($tmpPreserve)) { mkdir($tmpPreserve, 0755, true); } - rename($dirPath, $tmpPreserve . '/' . $dir); + if (!rename($dirPath, $tmpPreserve . '/' . $dir)) { + throw new \RuntimeException( + "Failed to preserve directory: {$dirPath}. " . + "Check permissions and ensure the directory is not locked." + ); + } } } @@ -292,7 +297,12 @@ private function replaceVendorFiles(string $noturRoot, string $sourcePath): void if (is_dir($destPath)) { $this->deleteDirectory($destPath); } - rename($tmpSource, $destPath); + if (!rename($tmpSource, $destPath)) { + throw new \RuntimeException( + "Failed to restore directory: {$tmpSource} to {$destPath}. " . + "Check permissions and ensure the directory is not locked." + ); + } } } From e05c8f92a6dee3c5d630e649de4beea2272bdc87 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 17:13:18 +0000 Subject: [PATCH 3/4] Improve error messages to include both source and destination paths Co-authored-by: sak0a <24781653+sak0a@users.noreply.github.com> --- src/Console/Commands/DevPullCommand.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Console/Commands/DevPullCommand.php b/src/Console/Commands/DevPullCommand.php index 2907a793..6b676263 100644 --- a/src/Console/Commands/DevPullCommand.php +++ b/src/Console/Commands/DevPullCommand.php @@ -272,9 +272,10 @@ private function replaceVendorFiles(string $noturRoot, string $sourcePath): void if (!is_dir($tmpPreserve)) { mkdir($tmpPreserve, 0755, true); } - if (!rename($dirPath, $tmpPreserve . '/' . $dir)) { + $tmpDest = $tmpPreserve . '/' . $dir; + if (!rename($dirPath, $tmpDest)) { throw new \RuntimeException( - "Failed to preserve directory: {$dirPath}. " . + "Failed to preserve directory from {$dirPath} to {$tmpDest}. " . "Check permissions and ensure the directory is not locked." ); } From 69580c2bd23d738e14cc622426afc04bc01f593d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 17:13:44 +0000 Subject: [PATCH 4/4] Make error messages consistent between preserve and restore operations Co-authored-by: sak0a <24781653+sak0a@users.noreply.github.com> --- src/Console/Commands/DevPullCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Console/Commands/DevPullCommand.php b/src/Console/Commands/DevPullCommand.php index 6b676263..84e1620b 100644 --- a/src/Console/Commands/DevPullCommand.php +++ b/src/Console/Commands/DevPullCommand.php @@ -275,7 +275,7 @@ private function replaceVendorFiles(string $noturRoot, string $sourcePath): void $tmpDest = $tmpPreserve . '/' . $dir; if (!rename($dirPath, $tmpDest)) { throw new \RuntimeException( - "Failed to preserve directory from {$dirPath} to {$tmpDest}. " . + "Failed to preserve directory: {$dirPath} to {$tmpDest}. " . "Check permissions and ensure the directory is not locked." ); }