fix(worktrees): default to HEAD when no startPoint provided

- Use git reset --hard HEAD by default when startPoint is not provided or is HEAD
- Preserve resetting to the provided startPoint when a concrete value is supplied
This commit is contained in:
Iuliia Ivashko
2026-01-29 21:34:24 +02:00
parent 0bd4dc12e4
commit dd6d78b0db
5 changed files with 22 additions and 6 deletions
@@ -71,6 +71,8 @@ export const buildSdkStartCommand = (args: {
const startPoint = typeof args.startPoint === 'string' ? args.startPoint.trim() : '';
if (startPoint && startPoint !== 'HEAD') {
commands.push(`git reset --hard ${shellQuote(startPoint)}`);
} else {
commands.push('git reset --hard HEAD');
}
for (const raw of args.setupCommands) {