Browse Source

Check out the branch instead of headless commit when creating a project

Jordi Boggiano 12 years ago
parent
commit
56b79125bf
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/Composer/Command/CreateProjectCommand.php

+ 4 - 0
src/Composer/Command/CreateProjectCommand.php

@@ -117,6 +117,10 @@ EOT
             }
         }
 
+        if (0 === strpos($package->getPrettyVersion(), 'dev-') && in_array($package->getSourceType(), array('git', 'hg'))) {
+            $package->setSourceReference(substr($package->getPrettyVersion(), 4));
+        }
+
         $io->write('<info>Installing ' . $package->getName() . ' (' . VersionParser::formatVersion($package, false) . ')</info>', true);
         $projectInstaller = new ProjectInstaller($directory, $dm);
         $projectInstaller->install(new InstalledFilesystemRepository(new JsonFile('php://memory')), $package);