From 43ddf450579d981ede8fd01e18cfffefd93ae539 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Wed, 15 Oct 2025 12:42:38 -0600 Subject: [PATCH] latest tweak Signed-off-by: Andy Miller --- system/src/Grav/Common/Upgrade/SafeUpgradeService.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Upgrade/SafeUpgradeService.php b/system/src/Grav/Common/Upgrade/SafeUpgradeService.php index c3092b013..26d3ee32b 100644 --- a/system/src/Grav/Common/Upgrade/SafeUpgradeService.php +++ b/system/src/Grav/Common/Upgrade/SafeUpgradeService.php @@ -74,7 +74,7 @@ class SafeUpgradeService $root = $options['root'] ?? GRAV_ROOT; $this->rootPath = rtrim($root, DIRECTORY_SEPARATOR); $this->parentDir = $options['parent_dir'] ?? dirname($this->rootPath); - $this->stagingRoot = $options['staging_root'] ?? ($this->parentDir . DIRECTORY_SEPARATOR . 'grav-upgrades'); + $this->stagingRoot = $options['staging_root'] ?? ($this->rootPath . DIRECTORY_SEPARATOR . 'grav-upgrades'); $this->manifestStore = $options['manifest_store'] ?? ($this->rootPath . DIRECTORY_SEPARATOR . 'user' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'upgrades'); if (isset($options['ignored_dirs']) && is_array($options['ignored_dirs'])) { $this->ignoredDirs = $options['ignored_dirs']; @@ -135,6 +135,7 @@ class SafeUpgradeService $packagePath = $stagePath . DIRECTORY_SEPARATOR . 'package'; $backupPath = $this->stagingRoot . DIRECTORY_SEPARATOR . 'rollback-' . $stageId; + Folder::create($this->stagingRoot); Folder::create($packagePath); // Copy extracted package into staging area. @@ -179,6 +180,7 @@ class SafeUpgradeService $rotated = $this->rotateCurrentTree(); $this->promoteBackup($backupPath); + $this->syncGitDirectory($rotated, $this->rootPath); $this->markRollback($manifest['id']); if ($rotated && is_dir($rotated)) { Folder::delete($rotated); @@ -420,6 +422,8 @@ class SafeUpgradeService rename($backupPath, $liveRoot); throw new RuntimeException('Failed to promote staged Grav release.'); } + + $this->syncGitDirectory($backupPath, $liveRoot); } /**