Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15419867
D19771.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
D19771.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
@@ -21,6 +21,7 @@
'limit' => 'optional int',
'offset' => 'optional int',
'contains' => 'optional string',
+ 'patterns' => 'optional list<string>',
);
}
@@ -31,15 +32,17 @@
$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();
- }
+ // See PHI958 (and, earlier, PHI720). If "patterns" are provided, pass
+ // them to "git branch ..." to let callers test for reachability from
+ // particular branch heads.
+ $patterns_argv = $request->getValue('patterns', array());
+ PhutilTypeSpec::checkMap(
+ array(
+ 'patterns' => $patterns_argv,
+ ),
+ array(
+ 'patterns' => 'list<string>',
+ ));
// NOTE: We can't use DiffusionLowLevelGitRefQuery here because
// `git for-each-ref` does not support `--contains`.
@@ -47,14 +50,14 @@
list($stdout) = $repository->execxLocalCommand(
'branch --verbose --no-abbrev --contains %s -- %Ls',
$contains,
- $pattern_argv);
+ $patterns_argv);
$ref_map = DiffusionGitBranch::parseLocalBranchOutput(
$stdout);
} else {
list($stdout) = $repository->execxLocalCommand(
'branch -r --verbose --no-abbrev --contains %s -- %Ls',
$contains,
- $pattern_argv);
+ $patterns_argv);
$ref_map = DiffusionGitBranch::parseRemoteBranchOutput(
$stdout,
DiffusionGitBranch::DEFAULT_GIT_REMOTE);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 22, 9:32 AM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7224189
Default Alt Text
D19771.diff (2 KB)
Attached To
Mode
D19771: Replace magical "branch" behavior in "diffusion.branchquery" with an explicit "patterns"
Attached
Detach File
Event Timeline
Log In to Comment