From 051118c500769d818bf85b0aecef20fa322ab9a8 Mon Sep 17 00:00:00 2001 From: Ulrich Kautz Date: Fri, 19 Oct 2012 12:56:59 +0200 Subject: [PATCH] Check for necessity of VCS cleanup when --prefer-dist is used (only project package, so far) --- src/Composer/Command/CreateProjectCommand.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Composer/Command/CreateProjectCommand.php b/src/Composer/Command/CreateProjectCommand.php index 99646ba13..00bb21094 100644 --- a/src/Composer/Command/CreateProjectCommand.php +++ b/src/Composer/Command/CreateProjectCommand.php @@ -169,6 +169,7 @@ EOT if ($package->getRepository() instanceof NotifiableRepositoryInterface) { $package->getRepository()->notifyInstall($package); } + $installedFromVcs = 'source' === $package->getInstallationSource(); $io->write('Created project in ' . $directory . ''); chdir($directory); @@ -197,6 +198,7 @@ EOT !$io->isInteractive() || $io->askConfirmation('Do you want to remove the exisitng VCS (.git, .svn..) history? [Y,n]? ', true) ) + && (!$preferDist || $installedFromVcs) ) { $finder = new Finder(); $finder->depth(1)->directories()->in(getcwd())->ignoreVCS(false)->ignoreDotFiles(false);