From 1c5f0026dea4b73dc5a7f872e4b7c92d1ebd31d4 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 4 Jun 2016 18:32:01 +0200 Subject: [PATCH] Throw exception if repository doesn't exist --- Utils/Git/Repository.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Utils/Git/Repository.php b/Utils/Git/Repository.php index 650a06aff..07f36baf6 100644 --- a/Utils/Git/Repository.php +++ b/Utils/Git/Repository.php @@ -689,7 +689,11 @@ class Repository continue; } - $fh = fopen($this->getDirectoryPath() . ($this->bare ? '/' : '/../') . $line, 'r'); + $fh = fopen($path = $this->getDirectoryPath() . ($this->bare ? '/' : '/../') . $line, 'r'); + + if(!$fh) { + throw new PathException($path); + } while (!feof($fh)) { fgets($fh);