@ogpoyraz/wtx 0.9.4 → 0.9.5

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.
Files changed (2) hide show
  1. package/dist/cli.mjs +14 -8
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -34492,15 +34492,21 @@ function registerPullBranchCommand(program2) {
34492
34492
  continue;
34493
34493
  }
34494
34494
  }
34495
- const candidatePath = getWorktreePath(repo, branchToPull);
34496
- const list = await getWorktreeList(repo.mainPath);
34497
- const target = findWorktreeForBranch(list, branchToPull, repo.mainPath, candidatePath);
34498
- if (!target) {
34499
- stepError(`No worktree found for branch '${branchToPull}'`, candidatePath);
34500
- failCount++;
34501
- continue;
34495
+ const mainBranch = await resolveMainBranch(repo, config2);
34496
+ let wtPath;
34497
+ if (branchToPull === mainBranch) {
34498
+ wtPath = repo.mainPath;
34499
+ } else {
34500
+ const candidatePath = getWorktreePath(repo, branchToPull);
34501
+ const list = await getWorktreeList(repo.mainPath);
34502
+ const target = findWorktreeForBranch(list, branchToPull, repo.mainPath, candidatePath);
34503
+ if (!target) {
34504
+ stepError(`No worktree found for branch '${branchToPull}'`, candidatePath);
34505
+ failCount++;
34506
+ continue;
34507
+ }
34508
+ wtPath = target.path;
34502
34509
  }
34503
- const wtPath = target.path;
34504
34510
  try {
34505
34511
  stepProgress(`Pulling ${branchToPull}...`);
34506
34512
  await gitExec(["-C", wtPath, "pull", "--ff-only"], opts);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ogpoyraz/wtx",
3
- "version": "0.9.4",
3
+ "version": "0.9.5",
4
4
  "description": "Multi-repo git worktree manager",
5
5
  "type": "module",
6
6
  "bin": {