From 4ef527c2a90e40b2170a6b84095344bc6dfb8504 Mon Sep 17 00:00:00 2001 From: roble Date: Sun, 7 Jun 2026 17:15:40 +0100 Subject: [PATCH] chore: refine update strategy to exclude 'path' dist types from merge stashing --- src/Installer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Installer.php b/src/Installer.php index b53129c..1e75608 100644 --- a/src/Installer.php +++ b/src/Installer.php @@ -567,7 +567,7 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini $stashPath = null; $basePath = null; - if ($this->getUpdateStrategy() === self::UPDATE_STRATEGY_MERGE) { + if ($this->getUpdateStrategy() === self::UPDATE_STRATEGY_MERGE && $initial->getDistType() !== 'path') { $stashPath = $this->stashModuleDir($this->getInstallPath($initial)); if ($stashPath !== null) { $basePath = sys_get_temp_dir().'/module-base-'.uniqid('', true); @@ -575,6 +575,8 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini } else { // Overwrite: stash for rollback safety rather than deleting outright. // $basePath stays null, which signals overwrite mode in the callbacks. + // Also covers initial=path: there's no remote dist to download as merge base, + // and stashing first would make the path inaccessible to PathDownloader. $stashPath = $this->stashModuleDir($installPath); }