MCPcopy Create free account
hub / github.com/ReviewStage/stage-cli / parseRefRange

Function parseRefRange

packages/cli/src/git.ts:289–307  ·  view source on GitHub ↗
(ref: string)

Source from the content-addressed store, hash-verified

287}
288
289function parseRefRange(ref: string): RefRange | null {
290 const threeDotIndex = ref.indexOf(RANGE_SEPARATOR.THREE_DOT);
291 if (threeDotIndex !== -1) {
292 return {
293 left: ref.slice(0, threeDotIndex),
294 right: ref.slice(threeDotIndex + RANGE_SEPARATOR.THREE_DOT.length),
295 };
296 }
297
298 const twoDotIndex = ref.indexOf(RANGE_SEPARATOR.TWO_DOT);
299 if (twoDotIndex !== -1) {
300 return {
301 left: ref.slice(0, twoDotIndex),
302 right: ref.slice(twoDotIndex + RANGE_SEPARATOR.TWO_DOT.length),
303 };
304 }
305
306 return null;
307}
308
309export function resolveCommittedComparison(left: string, right: string): ResolvedScope {
310 const effectiveLeft = left || "HEAD";

Callers 1

resolveScopeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected