mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 21:40:55 +01:00
Fix an issue with browsing repositories that have README, etc
Summary: D3533 changed the path for files at root from, e.g., "README" to "/README", which fatals when we try to `git cat-file` it. Test Plan: This no longer happens: {F24874} Viewed a directory in browse without a trailing slash in the URL. Reviewers: vrana, nh Reviewed By: vrana CC: aran Differential Revision: https://secure.phabricator.com/D4016
This commit is contained in:
parent
4d7b441834
commit
f4fa968770
1 changed files with 7 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue