@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.
- package/dist/cli.mjs +14 -8
- 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
|
|
34496
|
-
|
|
34497
|
-
|
|
34498
|
-
|
|
34499
|
-
|
|
34500
|
-
|
|
34501
|
-
|
|
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);
|