import { execute as executeSquash } from '../squash/execute.js'; import type { RebaseSnapshotSpec, RebaseSnapshotResult } from './types.js'; /** * rebase-snapshot re-uses the squash implementation. The difference is * intent: squash is called before merging a feature branch, rebase-snapshot * is called after a rebase that left ModelSnapshot.cs in a conflicted * state. Passing `mode: 'rebase-snapshot'` lowers the branch-only threshold * to 1 and lets it repair the snapshot even with zero branch-only migrations. */ export async function execute(spec: RebaseSnapshotSpec): Promise { return executeSquash({ cwd: spec.cwd, contextName: spec.contextName, description: spec.description, assembly: spec.assembly, baseBranch: spec.baseBranch, dryRun: spec.dryRun ?? false, mode: 'rebase-snapshot', allowBehindBase: spec.allowBehindBase ?? false, bruteForce: false, confirmBruteForce: false, aggressive: false, }); }