Sfoglia il codice sorgente

Stop hg from parsing project's repository information while installing dependencies from source (HgDownloader) or initializing a VcsRepository (HgDriver).

Per Bernhardt 13 anni fa
parent
commit
2fc49aa88b

+ 1 - 1
src/Composer/Downloader/HgDownloader.php

@@ -38,7 +38,7 @@ class HgDownloader implements DownloaderInterface
 
         $url = escapeshellarg($package->getSourceUrl());
         $ref = escapeshellarg($package->getSourceReference());
-        system(sprintf('hg clone %s %s && cd %2$s && hg up %s', $url, $path, $ref));
+        system(sprintf('(hg clone %s %s  2> /dev/null) && cd %2$s && hg up %s', $url, $path, $ref));
     }
 
     /**

+ 2 - 2
src/Composer/Repository/Vcs/HgDriver.php

@@ -41,7 +41,7 @@ class HgDriver implements VcsDriverInterface
         if (is_dir($this->tmpDir)) {
             exec(sprintf('cd %s && hg pull -u', $tmpDir), $output);
         } else {
-            exec(sprintf('hg clone %s %s', $url, $tmpDir), $output);
+            exec(sprintf('cd %s && hg clone %s %s', escapeshellarg(sys_get_temp_dir()), $url, $tmpDir), $output);
         }
 
         $this->getTags();
@@ -179,7 +179,7 @@ class HgDriver implements VcsDriverInterface
             return false;
         }
 
-        exec(sprintf('hg identify %s', escapeshellarg($url)), $ignored, $exit);
+        exec(sprintf('cd %s && hg identify %s', escapeshellarg(sys_get_temp_dir()), escapeshellarg($url)), $ignored, $exit);
         return $exit === 0;
     }
 }