MCPcopy Create free account
hub / github.com/dmno-dev/bumpy / getBaseCompareRef

Function getBaseCompareRef

packages/bumpy/src/core/git.ts:135–141  ·  view source on GitHub ↗
(rootDir: string, baseBranch: string)

Source from the content-addressed store, hash-verified

133 * Prefers the merge-base, falls back to `origin/<baseBranch>`.
134 */
135export function getBaseCompareRef(rootDir: string, baseBranch: string): string {
136 if (!tryRunArgs(['git', 'rev-parse', '--verify', `origin/${baseBranch}`], { cwd: rootDir })) {
137 tryRunArgs(['git', 'fetch', 'origin', baseBranch, '--depth=1'], { cwd: rootDir });
138 }
139 const mergeBase = tryRunArgs(['git', 'merge-base', 'HEAD', `origin/${baseBranch}`], { cwd: rootDir });
140 return mergeBase || `origin/${baseBranch}`;
141}
142
143/** Get files changed on this branch compared to a base branch */
144export function getChangedFiles(rootDir: string, baseBranch: string): string[] {

Callers 3

findChangedPackagesFunction · 0.90
getChangedCatalogEntriesFunction · 0.90
getChangedFilesFunction · 0.85

Calls 1

tryRunArgsFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…