From b928e7f8f52a84f25a0788e0239eba54140cc1a9 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 23 Sep 2013 18:23:55 -0700 Subject: [PATCH] Fix an issue with Diffusion where paging by commit date would fail Summary: When loading the cursor repository, we need to load the most recent commit too if we're paging by commit date. This fixes a fatal for installs with more than 100 repositories. Auditors: btrahan --- .../repository/query/PhabricatorRepositoryQuery.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/applications/repository/query/PhabricatorRepositoryQuery.php b/src/applications/repository/query/PhabricatorRepositoryQuery.php index 5bfe60e2da..3e63c71599 100644 --- a/src/applications/repository/query/PhabricatorRepositoryQuery.php +++ b/src/applications/repository/query/PhabricatorRepositoryQuery.php @@ -163,10 +163,15 @@ final class PhabricatorRepositoryQuery } private function loadCursorObject($id) { - $results = id(new PhabricatorRepositoryQuery()) + $query = id(new PhabricatorRepositoryQuery()) ->setViewer($this->getPagingViewer()) - ->withIDs(array((int)$id)) - ->execute(); + ->withIDs(array((int)$id)); + + if ($this->order == self::ORDER_COMMITTED) { + $query->needMostRecentCommits(true); + } + + $results = $query->execute(); return head($results); }