浏览代码

Force the origin remote url to be the original one and not that of a mirror

Jordi Boggiano 10 年之前
父节点
当前提交
fb1747624c
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/Composer/Downloader/GitDownloader.php

+ 4 - 0
src/Composer/Downloader/GitDownloader.php

@@ -60,6 +60,10 @@ class GitDownloader extends VcsDownloader
             }
             $package->setSourceReference($newRef);
         }
+
+        if ($url !== $package->getSourceUrl()) {
+            $this->process->execute(sprintf('git remote set-url origin %s', $package->getSourceUrl()), $output, $path);
+        }
     }
 
     /**