From a75da4efacbe06dbbe76305a2dcd435845317162 Mon Sep 17 00:00:00 2001 From: Jason Ge Date: Thu, 21 Jun 2012 20:24:12 -0700 Subject: [PATCH] Revert "run record commit if its the first time seen" Summary: This reverts commit 22e606d49e83ba3cbffcabd9d2a2fd74ee6759da. Test Plan: none Reviewers: epriestley, nh Reviewed By: nh CC: nh, vrana, aran, Korvin Differential Revision: https://secure.phabricator.com/D2833 --- .../PhabricatorRepositoryPullLocalDaemon.php | 30 +++++++------------ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php b/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php index ea1c0cd73a..7a0d53b025 100644 --- a/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php +++ b/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php @@ -329,8 +329,7 @@ final class PhabricatorRepositoryPullLocalDaemon private static function updateCommit( PhabricatorRepository $repository, $commit_identifier, - $branch, - $exists) { + $branch) { $commit = id(new PhabricatorRepositoryCommit())->loadOneWhere( 'repositoryID = %s AND commitIdentifier = %s', @@ -349,14 +348,12 @@ final class PhabricatorRepositoryPullLocalDaemon $data->setCommitDetail('seenOnBranches', $branches); $data->save(); - if (!$exists) { - self::insertTask( - $repository, - $commit, - array( - 'only' => true - )); - } + self::insertTask( + $repository, + $commit, + array( + 'only' => true + )); } private static function insertTask( @@ -615,17 +612,10 @@ final class PhabricatorRepositoryPullLocalDaemon $target); $epoch = trim($epoch); - $commit = id(new PhabricatorRepositoryCommit())->loadOneWhere( - 'repositoryID = %s AND commitIdentifier = %s', - $repository->getID(), - $target); - - if (!$commit) { - self::recordCommit($repository, $target, $epoch); - } - if ($branch !== null) { - self::updateCommit($repository, $target, $branch, $commit); + self::updateCommit($repository, $target, $branch); + } else { + self::recordCommit($repository, $target, $epoch); } if (empty($insert)) {