diff --git a/src/applications/diffusion/query/browse/DiffusionGitBrowseQuery.php b/src/applications/diffusion/query/browse/DiffusionGitBrowseQuery.php index 28fab2d3a0..3f6c81c76f 100644 --- a/src/applications/diffusion/query/browse/DiffusionGitBrowseQuery.php +++ b/src/applications/diffusion/query/browse/DiffusionGitBrowseQuery.php @@ -60,6 +60,12 @@ final class DiffusionGitBrowseQuery extends DiffusionBrowseQuery { $submodules = array(); + if (strlen($path)) { + $prefix = rtrim($path, '/').'/'; + } else { + $prefix = ''; + } + $results = array(); foreach (explode("\0", rtrim($stdout)) as $line) { @@ -83,7 +89,7 @@ final class DiffusionGitBrowseQuery extends DiffusionBrowseQuery { } } - $result->setFullPath(rtrim($path, '/').'/'.$name); + $result->setFullPath($prefix.$name); $result->setPath($name); $result->setHash($hash); $result->setFileType($file_type);