Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistGitHookPreReceiveWorkflow.php
| Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | EOTEXT | ||||
| public function shouldShellComplete() { | public function shouldShellComplete() { | ||||
| return false; | return false; | ||||
| } | } | ||||
| public function run() { | public function run() { | ||||
| $working_copy = $this->getWorkingCopy(); | $working_copy = $this->getWorkingCopy(); | ||||
| if (!$working_copy->getProjectID()) { | if (!$working_copy->getProjectID()) { | ||||
| throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
| "You have installed a git pre-receive hook in a remote without an ". | 'You have installed a git pre-receive hook in a remote without an '. | ||||
| ".arcconfig."); | '.arcconfig.'); | ||||
| } | } | ||||
| // Git repositories have special rules in pre-receive hooks. We need to | // Git repositories have special rules in pre-receive hooks. We need to | ||||
| // construct the API against the .git directory instead of the project | // construct the API against the .git directory instead of the project | ||||
| // root or commands don't work properly. | // root or commands don't work properly. | ||||
| $repository_api = ArcanistGitAPI::newHookAPI($_SERVER['PWD']); | $repository_api = ArcanistGitAPI::newHookAPI($_SERVER['PWD']); | ||||
| $root = $working_copy->getProjectRoot(); | $root = $working_copy->getProjectRoot(); | ||||
| ▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines | |||||