ui/server/src/reviewRefs
the Review mode's list source: LOCAL BRANCHES, read with git for-each-ref.
Cockpit server, v0.8. Source: ui/server/src/reviewRefs.mjs.
Variables#
localBranches#
constlocalBranches:object
Defined in: ui/server/src/reviewRefs.mjs:54
The adapter: what Review needs from a list source. A GitHub-PR source would implement the same shape.
Type Declaration#
id
id:
string='local-branches'
label
label:
string='Local branches'
list
list: (
cwd) => {branches?:undefined;code:any;current?:undefined;message:any;ok:boolean;top?:undefined; } | {branches:object[];code?:undefined;current:string;message?:undefined;ok:boolean;top:any; } =listLocalBranches
Every local branch of the repository containing cwd. {ok:true, branches, current, top} or {ok:false, code, message}.
Parameters
cwd
any
Returns
{ branches?: undefined; code: any; current?: undefined; message: any; ok: boolean; top?: undefined; } | { branches: object[]; code?: undefined; current: string; message?: undefined; ok: boolean; top: any; }
resolve
resolve: (
branches,name) =>any=resolveListed
The listed branch whose name is EXACTLY name, or null. The one place a client string becomes a ref.
Parameters
branches
any
name
any
Returns
any
Functions#
commitsAhead()#
commitsAhead(
top,baseSha,headSha):number
Defined in: ui/server/src/reviewRefs.mjs:47
Commits on head that base does not have. Both are commit ids taken from the validated list.
Parameters#
top
any
baseSha
any
headSha
any
Returns#
number
defaultBase()#
defaultBase(
branches,current):any
Defined in: ui/server/src/reviewRefs.mjs:41
The branch a change is reviewed against by default: main, then master, then the checked-out one.
Parameters#
branches
any
current
any
Returns#
any
listLocalBranches()#
listLocalBranches(
cwd): {branches?:undefined;code:any;current?:undefined;message:any;ok:boolean;top?:undefined; } | {branches:object[];code?:undefined;current:string;message?:undefined;ok:boolean;top:any; }
Defined in: ui/server/src/reviewRefs.mjs:20
Every local branch of the repository containing cwd. {ok:true, branches, current, top} or {ok:false, code, message}.
Parameters#
cwd
any
Returns#
{ branches?: undefined; code: any; current?: undefined; message: any; ok: boolean; top?: undefined; } | { branches: object[]; code?: undefined; current: string; message?: undefined; ok: boolean; top: any; }
resolveListed()#
resolveListed(
branches,name):any
Defined in: ui/server/src/reviewRefs.mjs:35
The listed branch whose name is EXACTLY name, or null. The one place a client string becomes a ref.
Parameters#
branches
any
name
any
Returns#
any