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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user