Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/request/DiffusionGitRequest.php
<?php | <?php | ||||
final class DiffusionGitRequest extends DiffusionRequest { | final class DiffusionGitRequest extends DiffusionRequest { | ||||
protected function isStableCommit($symbol) { | protected function isStableCommit($symbol) { | ||||
if (!phutil_nonempty_string($symbol)) { | |||||
return false; | |||||
} | |||||
return preg_match('/^[a-f0-9]{40}\z/', $symbol); | return preg_match('/^[a-f0-9]{40}\z/', $symbol); | ||||
} | } | ||||
public function getBranch() { | public function getBranch() { | ||||
if ($this->branch) { | if ($this->branch) { | ||||
return $this->branch; | return $this->branch; | ||||
} | } | ||||
if ($this->repository) { | if ($this->repository) { | ||||
return $this->repository->getDefaultBranch(); | return $this->repository->getDefaultBranch(); | ||||
} | } | ||||
throw new Exception(pht('Unable to determine branch!')); | throw new Exception(pht('Unable to determine branch!')); | ||||
} | } | ||||
} | } |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0