Differential D20450 Diff 48808 src/applications/diffusion/query/lowlevel/DiffusionLowLevelGitRefQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/query/lowlevel/DiffusionLowLevelGitRefQuery.php
Show All 27 Lines | protected function executeQuery() { | ||||
$with_branches = isset($ref_types[$type_branch]); | $with_branches = isset($ref_types[$type_branch]); | ||||
$with_tags = isset($ref_types[$type_tag]); | $with_tags = isset($ref_types[$type_tag]); | ||||
$with_refs = isset($refs_types[$type_ref]); | $with_refs = isset($refs_types[$type_ref]); | ||||
$repository = $this->getRepository(); | $repository = $this->getRepository(); | ||||
$prefixes = array(); | $prefixes = array(); | ||||
if ($repository->isWorkingCopyBare()) { | |||||
$branch_prefix = 'refs/heads/'; | $branch_prefix = 'refs/heads/'; | ||||
} else { | |||||
$remote = DiffusionGitBranch::DEFAULT_GIT_REMOTE; | |||||
$branch_prefix = 'refs/remotes/'.$remote.'/'; | |||||
} | |||||
$tag_prefix = 'refs/tags/'; | $tag_prefix = 'refs/tags/'; | ||||
if ($with_refs || count($ref_types) > 1) { | if ($with_refs || count($ref_types) > 1) { | ||||
// If we're loading refs or more than one type of ref, just query | // If we're loading refs or more than one type of ref, just query | ||||
// everything. | // everything. | ||||
$prefix = 'refs/'; | $prefix = 'refs/'; | ||||
} else { | } else { | ||||
if ($with_branches) { | if ($with_branches) { | ||||
$prefix = $branch_prefix; | $prefix = $branch_prefix; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 127 Lines • Show Last 20 Lines |