Browse Source

Allow using fossil dependency in a fossil repository, fixes #7125, closes #7126

Edwin Rodríguez 7 years ago
parent
commit
9dc6222288

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

@@ -36,7 +36,7 @@ class FossilDownloader extends VcsDownloader
         if (0 !== $this->process->execute($command, $ignoredOutput)) {
             throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
         }
-        $command = sprintf('fossil open %s', ProcessExecutor::escape($repoFile));
+        $command = sprintf('fossil open %s --nested', ProcessExecutor::escape($repoFile));
         if (0 !== $this->process->execute($command, $ignoredOutput, realpath($path))) {
             throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
         }

+ 1 - 1
src/Composer/Repository/Vcs/FossilDriver.php

@@ -96,7 +96,7 @@ class FossilDriver extends VcsDriver
                 throw new \RuntimeException('Failed to clone '.$this->url.' to repository ' . $this->repoFile . "\n\n" .$output);
             }
 
-            if (0 !== $this->process->execute(sprintf('fossil open %s', ProcessExecutor::escape($this->repoFile)), $output, $this->checkoutDir)) {
+            if (0 !== $this->process->execute(sprintf('fossil open %s --nested', ProcessExecutor::escape($this->repoFile)), $output, $this->checkoutDir)) {
                 $output = $this->process->getErrorOutput();
 
                 throw new \RuntimeException('Failed to open repository '.$this->repoFile.' in ' . $this->checkoutDir . "\n\n" .$output);

+ 1 - 1
tests/Composer/Test/Downloader/FossilDownloaderTest.php

@@ -76,7 +76,7 @@ class FossilDownloaderTest extends TestCase
             ->with($this->equalTo($expectedFossilCommand))
             ->will($this->returnValue(0));
 
-        $expectedFossilCommand = $this->getCmd('fossil open \'repo.fossil\'');
+        $expectedFossilCommand = $this->getCmd('fossil open \'repo.fossil\' --nested');
         $processExecutor->expects($this->at(1))
             ->method('execute')
             ->with($this->equalTo($expectedFossilCommand))