Page MenuHomePhabricator

D10746.diff
No OneTemporary

D10746.diff

diff --git a/src/applications/diffusion/data/DiffusionCommitHash.php b/src/applications/diffusion/data/DiffusionCommitHash.php
--- a/src/applications/diffusion/data/DiffusionCommitHash.php
+++ b/src/applications/diffusion/data/DiffusionCommitHash.php
@@ -23,4 +23,15 @@
return $this->hashType;
}
+ public static function convertArrayToObjects(array $hashes) {
+ $hash_objects = array();
+ foreach ($hashes as $hash) {
+ $type = $hash[0];
+ $hash = $hash[1];
+ $hash_objects[] = id(new DiffusionCommitHash())
+ ->setHashType($type)
+ ->setHashValue($hash);
+ }
+ return $hash_objects;
+ }
}
diff --git a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitFieldsQuery.php b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitFieldsQuery.php
--- a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitFieldsQuery.php
+++ b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitFieldsQuery.php
@@ -71,6 +71,8 @@
$revision = $this->pickBestRevision($revisions);
$fields['revisionID'] = $revision->getID();
$revision_hashes = $revision->getHashes();
+ $revision_hashes = DiffusionCommitHash::convertArrayToObjects(
+ $revision_hashes);
$revision_hashes = mpull($revision_hashes, 'getHashType');
// sort the hashes in the order the mighty
// @{class:ArcanstDifferentialRevisionHash} does; probably unnecessary
@@ -79,7 +81,10 @@
$revision_hashes,
ArcanistDifferentialRevisionHash::getTypes());
foreach ($hashes as $hash) {
- $revision_hash = $revision_hashes[$hash->getHashType()];
+ $revision_hash = idx($revision_hashes, $hash->getHashType());
+ if (!$revision_hash) {
+ continue;
+ }
if ($revision_hash->getHashValue() == $hash->getHashValue()) {
$this->setRevisionMatchData(
'matchHashType',

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 6:27 PM (17 h, 2 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6911570
Default Alt Text
D10746.diff (1 KB)

Event Timeline