Fixed wrong path detection on Windows

This commit is contained in:
Sebastiaan Stok
2012-08-31 11:34:02 +02:00
parent 1afeaea987
commit 75a00574b5
2 changed files with 6 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
<?php <?php
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' && !defined('WINDOWS_BUILD')) {
define('WINDOWS_BUILD', 1); define('WINDOWS_BUILD', 1);
} }
@@ -17,4 +17,4 @@ $app->mount('', new GitList\Controller\BlobController());
$app->mount('', new GitList\Controller\CommitController()); $app->mount('', new GitList\Controller\CommitController());
$app->mount('', new GitList\Controller\TreeController()); $app->mount('', new GitList\Controller\TreeController());
return $app; return $app;

View File

@@ -90,7 +90,9 @@ class Client
$isRepository = file_exists($file->getPathname() . '/.git/HEAD'); $isRepository = file_exists($file->getPathname() . '/.git/HEAD');
if ($isRepository || $isBare) { if ($isRepository || $isBare) {
if (in_array($file->getPathname(), $this->getHidden())) { $pathName = str_replace('\\', '/', $file->getPathname());
if (in_array($pathName, $this->getHidden())) {
continue; continue;
} }
@@ -106,7 +108,7 @@ class Client
$description = 'There is no repository description file. Please, create one to remove this message.'; $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; continue;
} }
} }