From c0309f22d7050df0e93c85483ec441613c005b5b Mon Sep 17 00:00:00 2001 From: Ryan Aslett Date: Mon, 10 Aug 2020 12:51:48 -0700 Subject: [PATCH] Update PathDownloader.php If a path repository points at a directory that is managed by composer installers, the path that gets set ends up being relative, and this check fails to see that the source is already present, and therefore removes it. Since ->install is already using realpath around the $path argument, remove should as well. For an example repository that demonstrates this bug See: https://github.com/ryanaslett/pathrepotestcase --- src/Composer/Downloader/PathDownloader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Downloader/PathDownloader.php b/src/Composer/Downloader/PathDownloader.php index 190267c5c..94c6fb71b 100644 --- a/src/Composer/Downloader/PathDownloader.php +++ b/src/Composer/Downloader/PathDownloader.php @@ -180,7 +180,7 @@ class PathDownloader extends FileDownloader implements VcsCapableDownloaderInter { $realUrl = realpath($package->getDistUrl()); - if ($path === $realUrl) { + if (realpath($path) === $realUrl) { if ($output) { $this->io->writeError(" - " . UninstallOperation::format($package).", source is still present in $path"); }