From a18de93a8c83d1af2f8d1a0f13b227799814acf7 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 8 Oct 2012 16:51:50 -0700 Subject: [PATCH] Don't link files with no rendering changeset in DiffusionCommitChangeTableView Summary: When directories are added (e.g., on the `hg` initial commit, "/" is added) we don't render any diff for them but try to link to it in the table of contents. Possibly we should render a diff saying "this directory was added", but stop it from complaining for now. Test Plan: Looked at several hg and git commits which add directories to verify this gives us generally sensible behvior. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D3663 --- .../view/DiffusionCommitChangeTableView.php | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/applications/diffusion/view/DiffusionCommitChangeTableView.php b/src/applications/diffusion/view/DiffusionCommitChangeTableView.php index 78c66f172e..7deb75b6f0 100644 --- a/src/applications/diffusion/view/DiffusionCommitChangeTableView.php +++ b/src/applications/diffusion/view/DiffusionCommitChangeTableView.php @@ -54,17 +54,21 @@ final class DiffusionCommitChangeTableView extends DiffusionView { $path .= '/'; } - $path_column = javelin_render_tag( - 'a', - array( - 'href' => '#'.$hash, - 'meta' => array( - 'id' => 'diff-'.$hash, - 'ref' => $this->renderingReferences[$id], + if (isset($this->renderingReferences[$id])) { + $path_column = javelin_render_tag( + 'a', + array( + 'href' => '#'.$hash, + 'meta' => array( + 'id' => 'diff-'.$hash, + 'ref' => $this->renderingReferences[$id], + ), + 'sigil' => 'differential-load', ), - 'sigil' => 'differential-load', - ), - phutil_escape_html($path)); + phutil_escape_html($path)); + } else { + $path_column = phutil_escape_html($path); + } $rows[] = array( $this->linkHistory($change->getPath()),