Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14775905
D19499.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D19499.diff
View Options
diff --git a/src/applications/diffusion/conduit/DiffusionBranchQueryConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionBranchQueryConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionBranchQueryConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionBranchQueryConduitAPIMethod.php
@@ -30,18 +30,31 @@
$contains = $request->getValue('contains');
if (strlen($contains)) {
+
+ // See PHI720. If the standard "branch" field is provided, use it
+ // as the "pattern" argument to "git branch ..." to let callers test
+ // for reachability from a particular branch head.
+ $pattern = $request->getValue('branch');
+ if (strlen($pattern)) {
+ $pattern_argv = array($pattern);
+ } else {
+ $pattern_argv = array();
+ }
+
// NOTE: We can't use DiffusionLowLevelGitRefQuery here because
// `git for-each-ref` does not support `--contains`.
if ($repository->isWorkingCopyBare()) {
list($stdout) = $repository->execxLocalCommand(
- 'branch --verbose --no-abbrev --contains %s --',
- $contains);
+ 'branch --verbose --no-abbrev --contains %s -- %Ls',
+ $contains,
+ $pattern_argv);
$ref_map = DiffusionGitBranch::parseLocalBranchOutput(
$stdout);
} else {
list($stdout) = $repository->execxLocalCommand(
- 'branch -r --verbose --no-abbrev --contains %s --',
- $contains);
+ 'branch -r --verbose --no-abbrev --contains %s -- %Ls',
+ $contains,
+ $pattern_argv);
$ref_map = DiffusionGitBranch::parseRemoteBranchOutput(
$stdout,
DiffusionGitBranch::DEFAULT_GIT_REMOTE);
diff --git a/src/applications/diffusion/controller/DiffusionCommitBranchesController.php b/src/applications/diffusion/controller/DiffusionCommitBranchesController.php
--- a/src/applications/diffusion/controller/DiffusionCommitBranchesController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitBranchesController.php
@@ -22,6 +22,7 @@
array(
'contains' => $drequest->getCommit(),
'limit' => $branch_limit + 1,
+ 'branch' => null,
)));
$has_more_branches = (count($branches) > $branch_limit);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 25, 3:28 AM (14 h, 20 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7046298
Default Alt Text
D19499.diff (2 KB)
Attached To
Mode
D19499: If "branch" is provided to "diffusion.branchquery", use it as the "<pattern>" argument to "git branch --contains ..."
Attached
Detach File
Event Timeline
Log In to Comment