Browse Source

properly cache when a branch in a certain revision does not contain a composer.json

this prevents requesting/trying to get the composer.json over and over again even if no commits happend

Closes #7156
Markus Staab 7 years ago
parent
commit
af3783b5f4
1 changed files with 10 additions and 1 deletions
  1. 10 1
      src/Composer/Repository/Vcs/SvnDriver.php

+ 10 - 1
src/Composer/Repository/Vcs/SvnDriver.php

@@ -133,7 +133,16 @@ class SvnDriver extends VcsDriver
                 return $this->infoCache[$identifier] = JsonFile::parseJson($res);
                 return $this->infoCache[$identifier] = JsonFile::parseJson($res);
             }
             }
 
 
-            $composer = $this->getBaseComposerInformation($identifier);
+            try {
+                $composer = $this->getBaseComposerInformation($identifier);
+            } catch(TransportException $e) {
+                $message = $e->getMessage();
+                if (stripos($message, 'path not found') === false && stripos($message, 'svn: warning: W160013') === false) {
+                    throw $e;
+                }
+                // remember a not-existent composer.json
+                $composer = '';
+            }
 
 
             if ($this->shouldCache($identifier)) {
             if ($this->shouldCache($identifier)) {
                 $this->cache->write($identifier.'.json', json_encode($composer));
                 $this->cache->write($identifier.'.json', json_encode($composer));