Changeset View
Changeset View
Standalone View
Standalone View
src/repository/api/ArcanistGitAPI.php
| Show All 14 Lines | final class ArcanistGitAPI extends ArcanistRepositoryAPI { | ||||
| const GIT_MAGIC_ROOT_COMMIT = '4b825dc642cb6eb9a060e54bf8d69288fbee4904'; | const GIT_MAGIC_ROOT_COMMIT = '4b825dc642cb6eb9a060e54bf8d69288fbee4904'; | ||||
| private $symbolicHeadCommit; | private $symbolicHeadCommit; | ||||
| private $resolvedHeadCommit; | private $resolvedHeadCommit; | ||||
| protected function buildLocalFuture(array $argv) { | protected function buildLocalFuture(array $argv) { | ||||
| $argv[0] = 'git '.$argv[0]; | $argv[0] = 'git '.$argv[0]; | ||||
| $future = newv('ExecFuture', $argv); | return newv('ExecFuture', $argv) | ||||
| $future->setCWD($this->getPath()); | ->setCWD($this->getPath()); | ||||
| return $future; | |||||
| } | } | ||||
| public function execPassthru($pattern /* , ... */) { | public function newPassthru($pattern /* , ... */) { | ||||
| $args = func_get_args(); | $args = func_get_args(); | ||||
| static $git = null; | static $git = null; | ||||
| if ($git === null) { | if ($git === null) { | ||||
| if (phutil_is_windows()) { | if (phutil_is_windows()) { | ||||
| // NOTE: On Windows, phutil_passthru() uses 'bypass_shell' because | // NOTE: On Windows, phutil_passthru() uses 'bypass_shell' because | ||||
| // everything goes to hell if we don't. We must provide an absolute | // everything goes to hell if we don't. We must provide an absolute | ||||
| // path to Git for this to work properly. | // path to Git for this to work properly. | ||||
| $git = Filesystem::resolveBinary('git'); | $git = Filesystem::resolveBinary('git'); | ||||
| $git = csprintf('%s', $git); | $git = csprintf('%s', $git); | ||||
| } else { | } else { | ||||
| $git = 'git'; | $git = 'git'; | ||||
| } | } | ||||
| } | } | ||||
| $args[0] = $git.' '.$args[0]; | $args[0] = $git.' '.$args[0]; | ||||
| return call_user_func_array('phutil_passthru', $args); | return newv('PhutilExecPassthru', $args) | ||||
| ->setCWD($this->getPath()); | |||||
| } | } | ||||
| public function getSourceControlSystemName() { | public function getSourceControlSystemName() { | ||||
| return 'git'; | return 'git'; | ||||
| } | } | ||||
| public function getGitVersion() { | public function getGitVersion() { | ||||
| static $version = null; | static $version = null; | ||||
| if ($version === null) { | if ($version === null) { | ||||
| list($stdout) = $this->execxLocal('--version'); | list($stdout) = $this->execxLocal('--version'); | ||||
| ▲ Show 20 Lines • Show All 1,717 Lines • Show Last 20 Lines | |||||