@pushpalsdev/cli 1.0.63 → 1.0.64

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushpalsdev/cli",
3
- "version": "1.0.63",
3
+ "version": "1.0.64",
4
4
  "description": "PushPals terminal CLI for LocalBuddy -> RemoteBuddy orchestration",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -2614,11 +2614,43 @@ export async function syncHiddenRefWithRemoteBranchByRebase(
2614
2614
 
2615
2615
  const trackedCodex = await git(repo, ["ls-files", "--error-unmatch", "--", ".codex"]);
2616
2616
  if (trackedCodex.ok) {
2617
- return {
2618
- ok: false,
2619
- error:
2620
- "Tracked .codex path blocks branch sync. Move Codex state outside the repo worktree before retrying.",
2621
- };
2617
+ const restoreTrackedCodex = await git(repo, [
2618
+ "restore",
2619
+ "--source=HEAD",
2620
+ "--staged",
2621
+ "--worktree",
2622
+ "--",
2623
+ ".codex",
2624
+ ]);
2625
+ if (!restoreTrackedCodex.ok) {
2626
+ return {
2627
+ ok: false,
2628
+ error:
2629
+ `Tracked .codex path blocks branch sync and could not be restored to HEAD: ` +
2630
+ `${combinedGitOutput(restoreTrackedCodex)}`,
2631
+ };
2632
+ }
2633
+
2634
+ const trackedCodexStatus = await git(repo, ["status", "--porcelain", "--", ".codex"]);
2635
+ if (!trackedCodexStatus.ok) {
2636
+ return {
2637
+ ok: false,
2638
+ error:
2639
+ `Tracked .codex path blocks branch sync and its status could not be verified: ` +
2640
+ `${combinedGitOutput(trackedCodexStatus)}`,
2641
+ };
2642
+ }
2643
+ if (trackedCodexStatus.stdout.trim().length > 0) {
2644
+ return {
2645
+ ok: false,
2646
+ error:
2647
+ "Tracked .codex path blocks branch sync because local changes remain after restore. " +
2648
+ "Move Codex state outside the repo worktree before retrying.",
2649
+ };
2650
+ }
2651
+
2652
+ console.warn("[WorkerPals] Preserved tracked .codex sentinel before branch sync.");
2653
+ return { ok: true };
2622
2654
  }
2623
2655
 
2624
2656
  try {