Differential D21448 Diff 51084 src/applications/repository/management/PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/management/PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.php
Show First 20 Lines • Show All 196 Lines • ▼ Show 20 Lines | public function execute(PhutilArgumentParser $args) { | ||||
return 0; | return 0; | ||||
} | } | ||||
private function rebuildCommits($commits) { | private function rebuildCommits($commits) { | ||||
foreach ($commits as $commit) { | foreach ($commits as $commit) { | ||||
$needs_update = false; | $needs_update = false; | ||||
$data = $commit->getCommitData(); | $data = $commit->getCommitData(); | ||||
$author_name = $data->getAuthorName(); | $author = $data->getAuthorString(); | ||||
$author_identity = $this->getIdentityForCommit( | $author_identity = $this->getIdentityForCommit( | ||||
$commit, | $commit, | ||||
$author_name); | $author); | ||||
$author_phid = $commit->getAuthorIdentityPHID(); | $author_phid = $commit->getAuthorIdentityPHID(); | ||||
$identity_phid = $author_identity->getPHID(); | $identity_phid = $author_identity->getPHID(); | ||||
$aidentity_phid = $identity_phid; | $aidentity_phid = $identity_phid; | ||||
if ($author_phid !== $identity_phid) { | if ($author_phid !== $identity_phid) { | ||||
$commit->setAuthorIdentityPHID($identity_phid); | $commit->setAuthorIdentityPHID($identity_phid); | ||||
$data->setCommitDetail('authorIdentityPHID', $identity_phid); | $data->setCommitDetail('authorIdentityPHID', $identity_phid); | ||||
$needs_update = true; | $needs_update = true; | ||||
} | } | ||||
$committer_name = $data->getCommitDetail('committer', null); | $committer_name = $data->getCommitterString(); | ||||
$committer_phid = $commit->getCommitterIdentityPHID(); | $committer_phid = $commit->getCommitterIdentityPHID(); | ||||
if (strlen($committer_name)) { | if (strlen($committer_name)) { | ||||
$committer_identity = $this->getIdentityForCommit( | $committer_identity = $this->getIdentityForCommit( | ||||
$commit, | $commit, | ||||
$committer_name); | $committer_name); | ||||
$identity_phid = $committer_identity->getPHID(); | $identity_phid = $committer_identity->getPHID(); | ||||
} else { | } else { | ||||
$identity_phid = null; | $identity_phid = null; | ||||
▲ Show 20 Lines • Show All 204 Lines • Show Last 20 Lines |