mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-10 14:51:06 +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();
|
$submodules = array();
|
||||||
|
|
||||||
|
if (strlen($path)) {
|
||||||
|
$prefix = rtrim($path, '/').'/';
|
||||||
|
} else {
|
||||||
|
$prefix = '';
|
||||||
|
}
|
||||||
|
|
||||||
$results = array();
|
$results = array();
|
||||||
foreach (explode("\0", rtrim($stdout)) as $line) {
|
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->setPath($name);
|
||||||
$result->setHash($hash);
|
$result->setHash($hash);
|
||||||
$result->setFileType($file_type);
|
$result->setFileType($file_type);
|
||||||
|
|
Loading…
Reference in a new issue