Do not prevent updates if untracked files are present
parent
0e9f88a3da
commit
ed8aa8322a
|
@ -61,7 +61,7 @@ class GitDownloader extends VcsDownloader
|
||||||
*/
|
*/
|
||||||
protected function enforceCleanDirectory($path)
|
protected function enforceCleanDirectory($path)
|
||||||
{
|
{
|
||||||
$command = sprintf('cd %s && git status --porcelain', escapeshellarg($path));
|
$command = sprintf('cd %s && git status --porcelain --untracked-files=no', escapeshellarg($path));
|
||||||
if (0 !== $this->process->execute($command, $output)) {
|
if (0 !== $this->process->execute($command, $output)) {
|
||||||
throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
|
throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,7 +140,7 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
|
||||||
public function testUpdate()
|
public function testUpdate()
|
||||||
{
|
{
|
||||||
$expectedGitUpdateCommand = $this->getCmd("cd 'composerPath' && git remote set-url composer 'git://github.com/composer/composer' && git fetch composer && git fetch --tags composer && git checkout 'ref' && git reset --hard 'ref'");
|
$expectedGitUpdateCommand = $this->getCmd("cd 'composerPath' && git remote set-url composer 'git://github.com/composer/composer' && git fetch composer && git fetch --tags composer && git checkout 'ref' && git reset --hard 'ref'");
|
||||||
$expectedGitResetCommand = $this->getCmd("cd 'composerPath' && git status --porcelain");
|
$expectedGitResetCommand = $this->getCmd("cd 'composerPath' && git status --porcelain --untracked-files=no");
|
||||||
|
|
||||||
$packageMock = $this->getMock('Composer\Package\PackageInterface');
|
$packageMock = $this->getMock('Composer\Package\PackageInterface');
|
||||||
$packageMock->expects($this->any())
|
$packageMock->expects($this->any())
|
||||||
|
@ -173,7 +173,7 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
|
||||||
public function testUpdateThrowsRuntimeExceptionIfGitCommandFails()
|
public function testUpdateThrowsRuntimeExceptionIfGitCommandFails()
|
||||||
{
|
{
|
||||||
$expectedGitUpdateCommand = $this->getCmd("cd 'composerPath' && git remote set-url composer 'git://github.com/composer/composer' && git fetch composer && git fetch --tags composer && git checkout 'ref' && git reset --hard 'ref'");
|
$expectedGitUpdateCommand = $this->getCmd("cd 'composerPath' && git remote set-url composer 'git://github.com/composer/composer' && git fetch composer && git fetch --tags composer && git checkout 'ref' && git reset --hard 'ref'");
|
||||||
$expectedGitResetCommand = $this->getCmd("cd 'composerPath' && git status --porcelain");
|
$expectedGitResetCommand = $this->getCmd("cd 'composerPath' && git status --porcelain --untracked-files=no");
|
||||||
|
|
||||||
$packageMock = $this->getMock('Composer\Package\PackageInterface');
|
$packageMock = $this->getMock('Composer\Package\PackageInterface');
|
||||||
$packageMock->expects($this->any())
|
$packageMock->expects($this->any())
|
||||||
|
@ -202,7 +202,7 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
|
||||||
|
|
||||||
public function testRemove()
|
public function testRemove()
|
||||||
{
|
{
|
||||||
$expectedGitResetCommand = $this->getCmd("cd 'composerPath' && git status --porcelain");
|
$expectedGitResetCommand = $this->getCmd("cd 'composerPath' && git status --porcelain --untracked-files=no");
|
||||||
|
|
||||||
$packageMock = $this->getMock('Composer\Package\PackageInterface');
|
$packageMock = $this->getMock('Composer\Package\PackageInterface');
|
||||||
$processExecutor = $this->getMock('Composer\Util\ProcessExecutor');
|
$processExecutor = $this->getMock('Composer\Util\ProcessExecutor');
|
||||||
|
|
Loading…
Reference in New Issue