Page MenuHomePhabricator

If "branch" is provided to "diffusion.branchquery", use it as the "<pattern>" argument to "git branch --contains ..."
ClosedPublic

Authored by epriestley on Jun 21 2018, 10:31 PM.
Tags
None
Referenced Files
F15482005: D19499.id46637.diff
Wed, Apr 9, 1:54 AM
F15481918: D19499.id46629.diff
Wed, Apr 9, 12:35 AM
F15480683: D19499.id.diff
Tue, Apr 8, 3:42 PM
F15472171: D19499.diff
Apr 5 2025, 11:12 AM
F15466631: D19499.diff
Apr 3 2025, 7:46 AM
F15464652: D19499.id.diff
Apr 2 2025, 11:56 AM
F15461317: D19499.diff
Apr 1 2025, 7:24 AM
F15426801: D19499.id46637.diff
Mar 23 2025, 10:54 AM
Subscribers
None

Details

Summary

Ref T13151. See PHI720. If you want to test if commit X appears on specific branch Y, git branch --contains X -- Y is faster than (effectively) git branch --contains X | grep Y.

Since this call has a "branch" parameter anyway, use it as the pattern argument if provided.

Test Plan
  • Called the API method with no parameters, got all branches.
  • Called the API method with master, got just master.
  • Called the API method with maste*, got master. This behavior is not officially supported and may change in the future.
  • Viewed a commit, still saw all branches.
    • Grepped for diffusion.branchquery and verified that no remaining callsites pass a default "branch" parameter.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable