1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 13:30: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:
epriestley 2011-06-09 15:47:03 -07:00
parent 17306b7a92
commit 58ed932e53
2 changed files with 5 additions and 3 deletions

View file

@ -292,13 +292,15 @@ class DiffusionBrowseFileController extends DiffusionController {
// Create the row display.
$uri_path = $drequest->getUriPath();
$uri_rev = $drequest->getStableCommitName();
$uri_view = $view;
$uri_view = $view
? '?view='.$view
: null;
$l = phutil_render_tag(
'a',
array(
'class' => 'diffusion-line-link',
'href' => $uri_path.';'.$uri_rev.'$'.$n.'?view='.$view,
'href' => $uri_path.';'.$uri_rev.'$'.$n.$uri_view,
),
$n);

View file

@ -28,7 +28,7 @@ final class DiffusionGitFileContentQuery extends DiffusionFileContentQuery {
$local_path = $repository->getDetail('local-path');
if ($this->getNeedsBlame()) {
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,
$commit,
$path);