mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 21:40:55 +01:00
Fix some small Diffusion file browse view bugs
Summary: "--date short" was introduced to git somewhere between 1.7.2.2 and 1.7.3.4, despite 1.7.2.2 saying "--date <format>" in "git help blame". The older version of git accepts "--date=short", however. Also, the URI construction means you get "?view=" if you click a line number to get a deep link, which I found vaguely annoying. Drop 'view' if we don't need it. Test Plan: Looked at blame in my sandbox, although it worked before the date patch since I have 1.7.3.4. Clicked a line number. Switched viewmodes. Reviewed By: codeblock Reviewers: codeblock, jungejason, tuomaspelkonen, aran CC: aran, codeblock Differential Revision: 423
This commit is contained in:
parent
17306b7a92
commit
58ed932e53
2 changed files with 5 additions and 3 deletions
|
@ -292,13 +292,15 @@ class DiffusionBrowseFileController extends DiffusionController {
|
||||||
// Create the row display.
|
// Create the row display.
|
||||||
$uri_path = $drequest->getUriPath();
|
$uri_path = $drequest->getUriPath();
|
||||||
$uri_rev = $drequest->getStableCommitName();
|
$uri_rev = $drequest->getStableCommitName();
|
||||||
$uri_view = $view;
|
$uri_view = $view
|
||||||
|
? '?view='.$view
|
||||||
|
: null;
|
||||||
|
|
||||||
$l = phutil_render_tag(
|
$l = phutil_render_tag(
|
||||||
'a',
|
'a',
|
||||||
array(
|
array(
|
||||||
'class' => 'diffusion-line-link',
|
'class' => 'diffusion-line-link',
|
||||||
'href' => $uri_path.';'.$uri_rev.'$'.$n.'?view='.$view,
|
'href' => $uri_path.';'.$uri_rev.'$'.$n.$uri_view,
|
||||||
),
|
),
|
||||||
$n);
|
$n);
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ final class DiffusionGitFileContentQuery extends DiffusionFileContentQuery {
|
||||||
$local_path = $repository->getDetail('local-path');
|
$local_path = $repository->getDetail('local-path');
|
||||||
if ($this->getNeedsBlame()) {
|
if ($this->getNeedsBlame()) {
|
||||||
list($corpus) = execx(
|
list($corpus) = execx(
|
||||||
'(cd %s && git --no-pager blame -c -l --date short %s -- %s)',
|
'(cd %s && git --no-pager blame -c -l --date=short %s -- %s)',
|
||||||
$local_path,
|
$local_path,
|
||||||
$commit,
|
$commit,
|
||||||
$path);
|
$path);
|
||||||
|
|
Loading…
Reference in a new issue