Differential D21441 Diff 51078 src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
| Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | if ($this->shouldQueueFollowupTasks()) { | ||||
| )); | )); | ||||
| } | } | ||||
| } | } | ||||
| final protected function updateCommitData(DiffusionCommitRef $ref) { | final protected function updateCommitData(DiffusionCommitRef $ref) { | ||||
| $commit = $this->commit; | $commit = $this->commit; | ||||
| $author = $ref->getAuthor(); | $author = $ref->getAuthor(); | ||||
| $committer = $ref->getCommitter(); | $committer = $ref->getCommitter(); | ||||
| $hashes = $ref->getHashes(); | |||||
| $has_committer = (bool)strlen($committer); | $has_committer = (bool)strlen($committer); | ||||
| $viewer = PhabricatorUser::getOmnipotentUser(); | $viewer = PhabricatorUser::getOmnipotentUser(); | ||||
| $identity_engine = id(new DiffusionRepositoryIdentityEngine()) | $identity_engine = id(new DiffusionRepositoryIdentityEngine()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->setSourcePHID($commit->getPHID()); | ->setSourcePHID($commit->getPHID()); | ||||
| ▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | if ($has_committer) { | ||||
| $commit->setCommitterIdentityPHID($committer_identity->getPHID()); | $commit->setCommitterIdentityPHID($committer_identity->getPHID()); | ||||
| } | } | ||||
| $repository = $this->repository; | $repository = $this->repository; | ||||
| $author_phid = $data->getCommitDetail('authorPHID'); | $author_phid = $data->getCommitDetail('authorPHID'); | ||||
| $committer_phid = $data->getCommitDetail('committerPHID'); | $committer_phid = $data->getCommitDetail('committerPHID'); | ||||
| $user = new PhabricatorUser(); | |||||
| if ($author_phid) { | |||||
| $user = $user->loadOneWhere( | |||||
| 'phid = %s', | |||||
| $author_phid); | |||||
| } | |||||
| if ($author_phid != $commit->getAuthorPHID()) { | if ($author_phid != $commit->getAuthorPHID()) { | ||||
| $commit->setAuthorPHID($author_phid); | $commit->setAuthorPHID($author_phid); | ||||
| } | } | ||||
| $commit->setAuthorIdentityPHID($author_identity->getPHID()); | $commit->setAuthorIdentityPHID($author_identity->getPHID()); | ||||
| $commit->setSummary($data->getSummary()); | $commit->setSummary($data->getSummary()); | ||||
| $commit->save(); | $commit->save(); | ||||
| ▲ Show 20 Lines • Show All 144 Lines • Show Last 20 Lines | |||||