episoda 0.2.31 → 0.2.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1628,6 +1628,9 @@ var require_git_executor = __commonJS({
1628
1628
  const args = ["worktree", "add"];
1629
1629
  if (command.create) {
1630
1630
  args.push("-b", command.branch, command.path);
1631
+ if (command.startPoint) {
1632
+ args.push(command.startPoint);
1633
+ }
1631
1634
  } else {
1632
1635
  args.push(command.path, command.branch);
1633
1636
  }
@@ -3262,14 +3265,19 @@ var WorktreeManager = class _WorktreeManager {
3262
3265
  action: "fetch",
3263
3266
  remote: "origin"
3264
3267
  }, { cwd: this.bareRepoPath });
3265
- if (!fetchResult.success) {
3266
- console.warn("[worktree-manager] Failed to fetch from origin:", fetchResult.output);
3268
+ if (!fetchResult.success && createBranch) {
3269
+ console.error("[worktree-manager] Failed to fetch from origin:", fetchResult.output);
3270
+ return {
3271
+ success: false,
3272
+ error: "Failed to fetch latest refs from origin. Cannot create worktree with stale refs."
3273
+ };
3267
3274
  }
3268
3275
  const result = await this.gitExecutor.execute({
3269
3276
  action: "worktree_add",
3270
3277
  path: worktreePath,
3271
3278
  branch: branchName,
3272
- create: createBranch
3279
+ create: createBranch,
3280
+ startPoint: createBranch ? "origin/main" : void 0
3273
3281
  }, { cwd: this.bareRepoPath });
3274
3282
  if (!result.success) {
3275
3283
  return {