From 12c7c399ce1407d7777996eceb1ae455e1bbcbe5 Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Tue, 30 Dec 2014 15:17:49 -0800 Subject: [PATCH] Diffusion - fix first "old ref" in push log Summary: This is a fake hash of many 0s which ends up being a bad link. Detect the fake hash and don't print a link. Fixes T6826. Test Plan: looked at push log and no longer saw a many 0 entry for the first old ref. Reviewers: epriestley, chad Reviewed By: chad Subscribers: Korvin, epriestley Maniphest Tasks: T6826 Differential Revision: https://secure.phabricator.com/D11096 --- .../diffusion/view/DiffusionPushLogListView.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/applications/diffusion/view/DiffusionPushLogListView.php b/src/applications/diffusion/view/DiffusionPushLogListView.php index d4cbabbdc4..acb1b60131 100644 --- a/src/applications/diffusion/view/DiffusionPushLogListView.php +++ b/src/applications/diffusion/view/DiffusionPushLogListView.php @@ -52,6 +52,15 @@ final class DiffusionPushLogListView extends AphrontView { $event_id = $log->getPushEvent()->getID(); $callsign = $log->getRepository()->getCallsign(); + $old_ref_link = null; + if ($log->getRefOld() != DiffusionCommitHookEngine::EMPTY_HASH) { + $old_ref_link = phutil_tag( + 'a', + array( + 'href' => '/r'.$callsign.$log->getRefOld(), + ), + $log->getRefOldShort()); + } $rows[] = array( phutil_tag( 'a', @@ -70,12 +79,7 @@ final class DiffusionPushLogListView extends AphrontView { $log->getPushEvent()->getRemoteProtocol(), $log->getRefType(), $log->getRefName(), - phutil_tag( - 'a', - array( - 'href' => '/r'.$callsign.$log->getRefOld(), - ), - $log->getRefOldShort()), + $old_ref_link, phutil_tag( 'a', array(