Changeset View
Changeset View
Standalone View
Standalone View
src/toolset/workflow/ArcanistVersionWorkflow.php
| Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | if (!Filesystem::binaryExists('git')) { | ||||
| 'git')); | 'git')); | ||||
| } | } | ||||
| $roots = array( | $roots = array( | ||||
| 'arcanist' => dirname(phutil_get_library_root('arcanist')), | 'arcanist' => dirname(phutil_get_library_root('arcanist')), | ||||
| ); | ); | ||||
| foreach ($roots as $lib => $root) { | foreach ($roots as $lib => $root) { | ||||
| $is_git = false; | |||||
| $working_copy = ArcanistWorkingCopy::newFromWorkingDirectory($root); | $working_copy = ArcanistWorkingCopy::newFromWorkingDirectory($root); | ||||
| if ($working_copy) { | |||||
| $repository_api = $working_copy->newRepositoryAPI(); | $repository_api = $working_copy->getRepositoryAPI(); | ||||
| if ($repository_api instanceof ArcanistGitAPI) { | $is_git = ($repository_api instanceof ArcanistGitAPI); | ||||
| $is_git = true; | |||||
| } | |||||
| } | |||||
| if (!$is_git) { | if (!$is_git) { | ||||
| throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
| pht( | pht( | ||||
| 'Library "%s" (at "%s") is not a Git working copy, so no version '. | 'Library "%s" (at "%s") is not a Git working copy, so no version '. | ||||
| 'information can be provided.', | 'information can be provided.', | ||||
| $lib, | $lib, | ||||
| Filesystem::readablePath($root))); | Filesystem::readablePath($root))); | ||||
| Show All 18 Lines | |||||