mirror of
https://github.com/stablyai/orca.git
synced 2026-10-26 00:03:55 +00:00
12 lines
356 B
TypeScript
12 lines
356 B
TypeScript
export function normalizeHostedReviewHeadRef(ref: string): string {
|
|
return ref
|
|
.trim()
|
|
.replace(/^refs\/heads\//, '')
|
|
.replace(/^refs\/remotes\/[^/]+\//, '')
|
|
}
|
|
|
|
export function normalizeHostedReviewBaseRef(ref: string): string {
|
|
const normalized = normalizeHostedReviewHeadRef(ref)
|
|
return normalized.replace(/^(origin|upstream)\//, '')
|
|
}
|