Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/engine/DiffusionCommitHookEngine.php
Show First 20 Lines • Show All 401 Lines • ▼ Show 20 Lines | foreach ($lines as $line) { | ||||
$ref_old = $parts[0]; | $ref_old = $parts[0]; | ||||
$ref_new = $parts[1]; | $ref_new = $parts[1]; | ||||
$ref_raw = $parts[2]; | $ref_raw = $parts[2]; | ||||
if (preg_match('(^refs/heads/)', $ref_raw)) { | if (preg_match('(^refs/heads/)', $ref_raw)) { | ||||
$ref_type = PhabricatorRepositoryPushLog::REFTYPE_BRANCH; | $ref_type = PhabricatorRepositoryPushLog::REFTYPE_BRANCH; | ||||
$ref_raw = substr($ref_raw, strlen('refs/heads/')); | $ref_raw = substr($ref_raw, strlen('refs/heads/')); | ||||
} elseif (preg_match('(^refs/changes/)', $ref_raw)) { | |||||
$ref_type = PhabricatorRepositoryPushLog::REFTYPE_BRANCH; | |||||
$ref_raw = substr($ref_raw, strlen('refs/changes/')); | |||||
} else if (preg_match('(^refs/tags/)', $ref_raw)) { | } elseif (preg_match('(^refs/tags/)', $ref_raw)) { | ||||
$ref_type = PhabricatorRepositoryPushLog::REFTYPE_TAG; | $ref_type = PhabricatorRepositoryPushLog::REFTYPE_TAG; | ||||
$ref_raw = substr($ref_raw, strlen('refs/tags/')); | $ref_raw = substr($ref_raw, strlen('refs/tags/')); | ||||
} else { | } else { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
"Unable to identify the reftype of '%s'. Rejecting push.", | "Unable to identify the reftype of '%s'. Rejecting push.", | ||||
$ref_raw)); | $ref_raw)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 845 Lines • Show Last 20 Lines |