浏览代码

Fetch only non-dev packages from lock if doing a dev update fails due to a previously incomplete lock file, fixes #1650

Jordi Boggiano 12 年之前
父节点
当前提交
373ff04261
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      src/Composer/Installer.php

+ 6 - 1
src/Composer/Installer.php

@@ -377,7 +377,12 @@ class Installer
         // to the version specified in the lock, or their currently installed version
         if ($this->update && $this->updateWhitelist) {
             if ($this->locker->isLocked()) {
-                $currentPackages = $this->locker->getLockedRepository($withDevReqs)->getPackages();
+                try {
+                    $currentPackages = $this->locker->getLockedRepository($withDevReqs)->getPackages();
+                } catch (\RuntimeException $e) {
+                    // fetch only non-dev packages from lock if doing a dev update fails due to a previously incomplete lock file
+                    $currentPackages = $this->locker->getLockedRepository()->getPackages();
+                }
             } else {
                 $currentPackages = $installedRepo->getPackages();
             }