From 30733ca5750ca0ce57860b0bb5bbba3823092ebf Mon Sep 17 00:00:00 2001 From: Jason Ge Date: Sat, 9 Jul 2011 16:08:39 -0700 Subject: [PATCH] Fix searching for commits Summary: fix two issues. First is that the field in the query is not correct; the other is to make indexing handle deleted repository. Test Plan: indexed some commits and the search result looks correct. Reviewed By: epriestley Reviewers: epriestley, tuomaspelkonen CC: aran, epriestley Differential Revision: 633 --- .../phid/handle/data/PhabricatorObjectHandleData.php | 2 +- .../indexer/repository/PhabricatorSearchCommitIndexer.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/applications/phid/handle/data/PhabricatorObjectHandleData.php b/src/applications/phid/handle/data/PhabricatorObjectHandleData.php index f4fb0059d2..072cdafacc 100644 --- a/src/applications/phid/handle/data/PhabricatorObjectHandleData.php +++ b/src/applications/phid/handle/data/PhabricatorObjectHandleData.php @@ -52,7 +52,7 @@ class PhabricatorObjectHandleData { if ($commits) { $data_dao = newv('PhabricatorRepositoryCommitData', array()); $commit_data = $data_dao->loadAllWhere( - 'id IN (%Ld)', + 'commitID IN (%Ld)', mpull($commits, 'getID')); $commit_data = mpull($commit_data, null, 'getCommitID'); } diff --git a/src/applications/search/index/indexer/repository/PhabricatorSearchCommitIndexer.php b/src/applications/search/index/indexer/repository/PhabricatorSearchCommitIndexer.php index 569e3f62e1..e978555f99 100644 --- a/src/applications/search/index/indexer/repository/PhabricatorSearchCommitIndexer.php +++ b/src/applications/search/index/indexer/repository/PhabricatorSearchCommitIndexer.php @@ -31,6 +31,10 @@ class PhabricatorSearchCommitIndexer 'id = %d', $commit->getRepositoryID()); + if (!$repository) { + return; + } + $title = 'r'.$repository->getCallsign().$commit->getCommitIdentifier(). " ".$commit_data->getSummary();