Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/diffusion/request/DiffusionGitRequest.php
13402 views
1
<?php
2
3
final class DiffusionGitRequest extends DiffusionRequest {
4
5
protected function isStableCommit($symbol) {
6
return $symbol !== null && preg_match('/^[a-f0-9]{40}\z/', $symbol);
7
}
8
9
public function getBranch() {
10
if ($this->branch) {
11
return $this->branch;
12
}
13
if ($this->repository) {
14
return $this->repository->getDefaultBranch();
15
}
16
throw new Exception(pht('Unable to determine branch!'));
17
}
18
19
}
20
21