@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Diffusion - fix another commit importing case.

Summary: Fixes T6395. Ref T6350. I guess I missed this code spot in prior testing / I definitely didn't run an empty commit through it. Works now though.

Test Plan: made an empty commit and observed stuck importing status and errors in phd log. applied patch and commit successfully imported with no errors. made another empty commit and it imported as well

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6350, T6395

Differential Revision: https://secure.phabricator.com/D10746

+17 -1
+11
src/applications/diffusion/data/DiffusionCommitHash.php
··· 23 23 return $this->hashType; 24 24 } 25 25 26 + public static function convertArrayToObjects(array $hashes) { 27 + $hash_objects = array(); 28 + foreach ($hashes as $hash) { 29 + $type = $hash[0]; 30 + $hash = $hash[1]; 31 + $hash_objects[] = id(new DiffusionCommitHash()) 32 + ->setHashType($type) 33 + ->setHashValue($hash); 34 + } 35 + return $hash_objects; 36 + } 26 37 }
+6 -1
src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitFieldsQuery.php
··· 71 71 $revision = $this->pickBestRevision($revisions); 72 72 $fields['revisionID'] = $revision->getID(); 73 73 $revision_hashes = $revision->getHashes(); 74 + $revision_hashes = DiffusionCommitHash::convertArrayToObjects( 75 + $revision_hashes); 74 76 $revision_hashes = mpull($revision_hashes, 'getHashType'); 75 77 // sort the hashes in the order the mighty 76 78 // @{class:ArcanstDifferentialRevisionHash} does; probably unnecessary ··· 79 81 $revision_hashes, 80 82 ArcanistDifferentialRevisionHash::getTypes()); 81 83 foreach ($hashes as $hash) { 82 - $revision_hash = $revision_hashes[$hash->getHashType()]; 84 + $revision_hash = idx($revision_hashes, $hash->getHashType()); 85 + if (!$revision_hash) { 86 + continue; 87 + } 83 88 if ($revision_hash->getHashValue() == $hash->getHashValue()) { 84 89 $this->setRevisionMatchData( 85 90 'matchHashType',