Browse Source

Make it clear which package the error is for when detecting uncommitted changes

Jordi Boggiano 5 years ago
parent
commit
0b4763e6c7

+ 1 - 1
src/Composer/Downloader/GitDownloader.php

@@ -301,7 +301,7 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface
         $changes = array_map(function ($elem) {
             return '    '.$elem;
         }, preg_split('{\s*\r?\n\s*}', $changes));
-        $this->io->writeError('    <error>The package has modified files:</error>');
+        $this->io->writeError('    <error>'.$package->getPrettyName().' has modified files:</error>');
         $this->io->writeError(array_slice($changes, 0, 10));
         if (count($changes) > 10) {
             $this->io->writeError('    <info>' . (count($changes) - 10) . ' more files modified, choose "v" to view the full list</info>');

+ 2 - 2
src/Composer/Downloader/SvnDownloader.php

@@ -109,7 +109,7 @@ class SvnDownloader extends VcsDownloader
             return $util->execute($command, $url, $cwd, $path, $this->io->isVerbose());
         } catch (\RuntimeException $e) {
             throw new \RuntimeException(
-                'Package could not be downloaded, '.$e->getMessage()
+                $package->getPrettyName().' could not be downloaded, '.$e->getMessage()
             );
         }
     }
@@ -135,7 +135,7 @@ class SvnDownloader extends VcsDownloader
             return '    '.$elem;
         }, preg_split('{\s*\r?\n\s*}', $changes));
         $countChanges = count($changes);
-        $this->io->writeError(sprintf('    <error>The package has modified file%s:</error>', $countChanges === 1 ? '' : 's'));
+        $this->io->writeError(sprintf('    <error>'.$package->getPrettyName().' has modified file%s:</error>', $countChanges === 1 ? '' : 's'));
         $this->io->writeError(array_slice($changes, 0, 10));
         if ($countChanges > 10) {
             $remainingChanges = $countChanges - 10;