Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistDiffWorkflow.php
Show First 20 Lines • Show All 2,355 Lines • ▼ Show 20 Lines | private function getDiffOntoTargets() { | ||||
$api = $this->getRepositoryAPI(); | $api = $this->getRepositoryAPI(); | ||||
if (!($api instanceof ArcanistGitAPI)) { | if (!($api instanceof ArcanistGitAPI)) { | ||||
return null; | return null; | ||||
} | } | ||||
// If we track an upstream branch either directly or indirectly, use that. | // If we track an upstream branch either directly or indirectly, use that. | ||||
$branch = $api->getBranchName(); | $branch = $api->getBranchName(); | ||||
if (strlen($branch)) { | if (phutil_nonempty_string($branch)) { | ||||
$upstream_path = $api->getPathToUpstream($branch); | $upstream_path = $api->getPathToUpstream($branch); | ||||
$remote_branch = $upstream_path->getRemoteBranchName(); | $remote_branch = $upstream_path->getRemoteBranchName(); | ||||
if ($remote_branch !== null) { | if ($remote_branch !== null) { | ||||
return array( | return array( | ||||
array( | array( | ||||
'type' => 'branch', | 'type' => 'branch', | ||||
'name' => $remote_branch, | 'name' => $remote_branch, | ||||
'kind' => 'upstream', | 'kind' => 'upstream', | ||||
▲ Show 20 Lines • Show All 528 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0