From 75a00574b5156beb88d9ed94bcd00f63c05b8cf7 Mon Sep 17 00:00:00 2001 From: Sebastiaan Stok Date: Fri, 31 Aug 2012 11:34:02 +0200 Subject: [PATCH] Fixed wrong path detection on Windows --- boot.php | 4 ++-- src/GitList/Component/Git/Client.php | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/boot.php b/boot.php index d664cda..cc88f69 100644 --- a/boot.php +++ b/boot.php @@ -1,6 +1,6 @@ mount('', new GitList\Controller\BlobController()); $app->mount('', new GitList\Controller\CommitController()); $app->mount('', new GitList\Controller\TreeController()); -return $app; \ No newline at end of file +return $app; diff --git a/src/GitList/Component/Git/Client.php b/src/GitList/Component/Git/Client.php index 01ed3a8..bd17355 100644 --- a/src/GitList/Component/Git/Client.php +++ b/src/GitList/Component/Git/Client.php @@ -90,7 +90,9 @@ class Client $isRepository = file_exists($file->getPathname() . '/.git/HEAD'); if ($isRepository || $isBare) { - if (in_array($file->getPathname(), $this->getHidden())) { + $pathName = str_replace('\\', '/', $file->getPathname()); + + if (in_array($pathName, $this->getHidden())) { continue; } @@ -106,7 +108,7 @@ class Client $description = 'There is no repository description file. Please, create one to remove this message.'; } - $repositories[] = array('name' => $file->getFilename(), 'path' => $file->getPathname(), 'description' => $description); + $repositories[] = array('name' => $file->getFilename(), 'path' => $pathName, 'description' => $description); continue; } }