1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Don't fetch all commits without blame in Diffusion

Summary:
Otherwise useless query is executed:

  lang=sql
  SELECT c.*
  FROM `repository_commit` c
  ORDER BY c.epoch DESC

Test Plan: /diffusion/X/browse/x

Reviewers: epriestley

Reviewed By: epriestley

CC: aran

Differential Revision: https://secure.phabricator.com/D2186
This commit is contained in:
vrana 2012-04-10 01:32:47 -07:00
parent 347bc357fd
commit 76b534b560

View file

@ -342,13 +342,14 @@ final class DiffusionBrowseFileController extends DiffusionController {
++$line_number;
}
$commits = id(new PhabricatorAuditCommitQuery())
->withIdentifiers(
$drequest->getRepository()->getID(),
array_filter(ipull($display, 'commit')))
->needCommitData(true)
->execute();
$commits = mpull($commits, null, 'getCommitIdentifier');
$commits = array_filter(ipull($display, 'commit'));
if ($commits) {
$commits = id(new PhabricatorAuditCommitQuery())
->withIdentifiers($drequest->getRepository()->getID(), $commits)
->needCommitData(true)
->execute();
$commits = mpull($commits, null, 'getCommitIdentifier');
}
$request = $this->getRequest();
$user = $request->getUser();