next-issue 17.0.6 → 17.0.8

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 CHANGED
@@ -91,7 +91,7 @@ async function excludeStateDirectories(root, stream) {
91
91
  await write(stream, `added ${entry} to ${exclude}\n`);
92
92
  }
93
93
  }
94
- for (const entry of await removeIgnored(root, entries)) {
94
+ for (const entry of await removeIgnored(root, [`${STATE_DIR}/`, '.worktrees/'])) {
95
95
  await write(stream, `removed ${entry} from .gitignore\n`);
96
96
  }
97
97
  }
@@ -75,17 +75,24 @@ async function updateBase(repo, base, remote) {
75
75
  }
76
76
  export async function findWorktree(repo, branch) {
77
77
  const found = await holder(repo, branch);
78
- if (found === undefined || found.main || (await isHunt(repo, found.path))) {
78
+ if (found === undefined || found.main || !(await isOwn(repo, branch, found.path))) {
79
79
  return undefined;
80
80
  }
81
81
  return found.path;
82
82
  }
83
+ async function isOwn(repo, branch, path) {
84
+ return ((await samePath(path, join(repo.root, WORKTREE_DIR, `next-issue-${branch}`))) ||
85
+ (await samePath(path, join(repo.root, '.worktrees', branch))));
86
+ }
83
87
  async function refuseOwnWorktree(repo, issue, branch, start) {
84
88
  const found = await holder(repo, branch);
85
89
  if (found?.main) {
86
90
  throw new Error(`the main worktree at ${found.path} has branch ${branch} checked out, so the issue cannot have its own worktree; check out another branch there and try again`);
87
91
  }
88
- if (start && found !== undefined && !(await samePath(found.path, worktreePath(repo, issue)))) {
92
+ if (found !== undefined &&
93
+ !(await (start
94
+ ? samePath(found.path, worktreePath(repo, issue))
95
+ : isOwn(repo, branch, found.path)))) {
89
96
  throw new Error(`the worktree at ${found.path} has branch ${branch} checked out, so the issue cannot have its own worktree; check out another branch there and try again`);
90
97
  }
91
98
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "17.0.6",
3
+ "version": "17.0.8",
4
4
  "description": "Autonomous issue harness driven by the Claude Agent SDK",
5
5
  "keywords": [
6
6
  "github",