@ogpoyraz/wtx 0.9.4 → 0.9.6

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 +23 -9
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -25519,6 +25519,14 @@ async function fetchWorktreeData(opts, scope) {
25519
25519
  let hasMain = false;
25520
25520
  try {
25521
25521
  mainBranch = await resolveMainBranch(repo, config2);
25522
+ if (!opts.dryRun) {
25523
+ try {
25524
+ await gitExec(["-C", repo.mainPath, "pull", "--ff-only"], { dryRun: opts.dryRun });
25525
+ } catch (err) {
25526
+ warnings.push({ repoName: repo.name, message: `Failed to pull main for ${repo.name}: ${errorMessage3(err).split(`
25527
+ `)[0]}` });
25528
+ }
25529
+ }
25522
25530
  const wts = await getWorktreeList(repo.mainPath);
25523
25531
  let stackMetadata = { version: 1, branches: {} };
25524
25532
  try {
@@ -28216,7 +28224,7 @@ var init_HelpOverlay = __esm(() => {
28216
28224
  ["T (shift+t)", "Cycle theme presets"],
28217
28225
  ["c", "Open configuration"],
28218
28226
  ["e", "View data warnings (when count > 0)"],
28219
- ["r", "Refresh data"],
28227
+ ["r", "Refresh data (pull main)"],
28220
28228
  ["H", "Action history"],
28221
28229
  ["?", "Toggle help"],
28222
28230
  ["mouse drag", "Select text — copied to clipboard automatically"],
@@ -34492,15 +34500,21 @@ function registerPullBranchCommand(program2) {
34492
34500
  continue;
34493
34501
  }
34494
34502
  }
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;
34503
+ const mainBranch = await resolveMainBranch(repo, config2);
34504
+ let wtPath;
34505
+ if (branchToPull === mainBranch) {
34506
+ wtPath = repo.mainPath;
34507
+ } else {
34508
+ const candidatePath = getWorktreePath(repo, branchToPull);
34509
+ const list = await getWorktreeList(repo.mainPath);
34510
+ const target = findWorktreeForBranch(list, branchToPull, repo.mainPath, candidatePath);
34511
+ if (!target) {
34512
+ stepError(`No worktree found for branch '${branchToPull}'`, candidatePath);
34513
+ failCount++;
34514
+ continue;
34515
+ }
34516
+ wtPath = target.path;
34502
34517
  }
34503
- const wtPath = target.path;
34504
34518
  try {
34505
34519
  stepProgress(`Pulling ${branchToPull}...`);
34506
34520
  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.6",
4
4
  "description": "Multi-repo git worktree manager",
5
5
  "type": "module",
6
6
  "bin": {