patchrelay 0.41.0 → 0.41.1

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "service": "patchrelay",
3
- "version": "0.41.0",
4
- "commit": "4ad3af5dce7c",
5
- "builtAt": "2026-04-12T21:16:04.426Z"
3
+ "version": "0.41.1",
4
+ "commit": "da144bb1629f",
5
+ "builtAt": "2026-04-12T21:22:14.994Z"
6
6
  }
@@ -48,7 +48,7 @@ export class WorktreeManager {
48
48
  await execCommand(gitBin, ["-C", worktreePath, "reset", "--hard", "HEAD"], { timeoutMs: 30_000 });
49
49
  await execCommand(gitBin, ["-C", worktreePath, "clean", "-fd"], { timeoutMs: 30_000 });
50
50
  const checkoutTarget = hasRemoteBranch ? `origin/${branchName}` : branchName;
51
- const checkoutResult = await execCommand(gitBin, ["-C", worktreePath, "checkout", "-B", branchName, checkoutTarget], { timeoutMs: 30_000 });
51
+ const checkoutResult = await execCommand(gitBin, ["-C", worktreePath, "checkout", "--ignore-other-worktrees", "-B", branchName, checkoutTarget], { timeoutMs: 30_000 });
52
52
  if (checkoutResult.exitCode !== 0) {
53
53
  throw new Error(`Failed to restore ${branchName} worktree state: ${checkoutResult.stderr?.slice(0, 300) ?? "git checkout failed"}`);
54
54
  }
@@ -84,12 +84,16 @@ export class WorktreeManager {
84
84
  // Fetch latest main so the branch forks from a clean, up-to-date base.
85
85
  // This prevents branch contamination when local HEAD has drifted.
86
86
  // freshenWorktree in run-orchestrator acts as a secondary safety net.
87
- await execCommand(this.config.runner.gitBin, ["-C", repoPath, "fetch", "origin", "main"], {
87
+ const fetchResult = await execCommand(this.config.runner.gitBin, ["-C", repoPath, "fetch", "origin", "main"], {
88
88
  timeoutMs: 60_000,
89
89
  });
90
- await execCommand(this.config.runner.gitBin, ["-C", repoPath, "worktree", "add", "--force", "-B", branchName, worktreePath, "origin/main"], {
91
- timeoutMs: 120_000,
92
- });
90
+ if (fetchResult.exitCode !== 0) {
91
+ throw new Error(`Failed to fetch origin/main before creating issue worktree: ${fetchResult.stderr?.slice(0, 300) ?? "git fetch failed"}`);
92
+ }
93
+ const addResult = await execCommand(this.config.runner.gitBin, ["-C", repoPath, "worktree", "add", "--detach", worktreePath, "origin/main"], { timeoutMs: 120_000 });
94
+ if (addResult.exitCode !== 0) {
95
+ throw new Error(`Failed to create issue worktree at ${worktreePath}: ${addResult.stderr?.slice(0, 300) ?? "git worktree add failed"}`);
96
+ }
93
97
  }
94
98
  async assertTrustedExistingWorktree(repoPath, worktreeRoot, worktreePath, options) {
95
99
  const worktreeStats = lstatSync(worktreePath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchrelay",
3
- "version": "0.41.0",
3
+ "version": "0.41.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {