From af3783b5f40bae32a23e353eaf0a00c9b8ce82e2 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 5 Mar 2018 09:34:40 +0100 Subject: [PATCH] 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 --- src/Composer/Repository/Vcs/SvnDriver.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Composer/Repository/Vcs/SvnDriver.php b/src/Composer/Repository/Vcs/SvnDriver.php index b963f6856..822510601 100644 --- a/src/Composer/Repository/Vcs/SvnDriver.php +++ b/src/Composer/Repository/Vcs/SvnDriver.php @@ -133,7 +133,16 @@ class SvnDriver extends VcsDriver 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)) { $this->cache->write($identifier.'.json', json_encode($composer));