1
0
Fork 0

Fix issues introduced by #7191, fixes #7263

pull/7280/head
Jordi Boggiano 2018-04-13 15:51:58 +02:00
parent 03fb68009c
commit 0f373e3249
3 changed files with 7 additions and 16 deletions

View File

@ -101,7 +101,9 @@ EOT
if ($changes = $downloader->getLocalChanges($package, $targetDir)) { if ($changes = $downloader->getLocalChanges($package, $targetDir)) {
$errors[$targetDir] = $changes; $errors[$targetDir] = $changes;
} }
} elseif ($downloader instanceof VcsCapableDownloaderInterface) { }
if ($downloader instanceof VcsCapableDownloaderInterface) {
if ($currentRef = $downloader->getVcsReference($package, $targetDir)) { if ($currentRef = $downloader->getVcsReference($package, $targetDir)) {
switch ($package->getInstallationSource()) { switch ($package->getInstallationSource()) {
case 'source': case 'source':
@ -129,14 +131,12 @@ EOT
); );
} }
} }
} elseif ($downloader instanceof DvcsDownloaderInterface) { }
if ($downloader instanceof DvcsDownloaderInterface) {
if ($unpushed = $downloader->getUnpushedChanges($package, $targetDir)) { if ($unpushed = $downloader->getUnpushedChanges($package, $targetDir)) {
$unpushedChanges[$targetDir] = $unpushed; $unpushedChanges[$targetDir] = $unpushed;
} }
} elseif ($downloader instanceof DownloaderInterface) {
if ($changes = $downloader->getLocalChanges($package, $targetDir)) {
$errors[$targetDir] = $changes;
}
} }
} }

View File

@ -61,13 +61,4 @@ interface DownloaderInterface
* @return DownloaderInterface * @return DownloaderInterface
*/ */
public function setOutputProgress($outputProgress); public function setOutputProgress($outputProgress);
/**
* Checks for changes to the local copy
*
* @param PackageInterface $package package instance
* @param string $path package directory
* @return string|null changes or null
*/
public function getLocalChanges(PackageInterface $package, $path);
} }

View File

@ -35,7 +35,7 @@ use Composer\Util\Url as UrlUtil;
* @author François Pluchino <francois.pluchino@opendisplay.com> * @author François Pluchino <francois.pluchino@opendisplay.com>
* @author Nils Adermann <naderman@naderman.de> * @author Nils Adermann <naderman@naderman.de>
*/ */
class FileDownloader implements DownloaderInterface class FileDownloader implements DownloaderInterface, ChangeReportInterface
{ {
protected $io; protected $io;
protected $config; protected $config;