MCPcopy Index your code
hub / github.com/refined-github/refined-github / getBranches

Function getBranches

source/github-helpers/pr-branches.ts:66–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64}
65
66export function getBranches(): {base: PrReference; head: PrReference} {
67 return {
68 get base() {
69 return parseReference($([
70 '[class*="PullRequestHeaderSummary"] a[class^="PullRequestBranchName"]',
71 // TODO [2026-08-01]: Remove
72 '[class*="PullRequestHeaderSummary"] > [class*="PullRequestHeaderSummary"]',
73 '.base-ref', // TODO [2027-01-01]: Drop after legacy PR files view is removed
74 ]));
75 },
76 get head() {
77 return parseReference(
78 // Doesn't exist in old views
79 $$optional('[class*="PullRequestHeaderSummary"] a[class^="PullRequestBranchName"]')?.[1]
80 ?? $([
81 // TODO [2026-08-01]: Remove
82 '[class*="PullRequestHeaderSummary"] * [class*="PullRequestHeaderSummary"]',
83 '.head-ref', // TODO [2027-01-01]: Drop after legacy PR files view is removed
84 ]),
85 );
86 },
87 };
88}

Callers 10

getMergeBaseReferenceFunction · 0.85
getHeadReferenceFunction · 0.85
discardChangesFunction · 0.85
rebuildFileLinkFunction · 0.85
isPrAgainstDefaultBranchFunction · 0.85
getBaseCommitNoticeFunction · 0.85
addInfoFunction · 0.85
handlerFunction · 0.85
isBranchUpdatableFunction · 0.85
initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected