1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 17:52:43 +01:00
phorge-phorge/src/applications/diffusion/data/DiffusionCommitHash.php
Bob Trahan 0dcc4132be 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
2014-10-27 12:19:07 -07:00

37 lines
771 B
PHP

<?php
final class DiffusionCommitHash extends Phobject {
private $hashType;
private $hashValue;
public function setHashValue($hash_value) {
$this->hashValue = $hash_value;
return $this;
}
public function getHashValue() {
return $this->hashValue;
}
public function setHashType($hash_type) {
$this->hashType = $hash_type;
return $this;
}
public function getHashType() {
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;
}
}