next-issue 17.0.5 → 17.0.7

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
  }
@@ -20,6 +20,9 @@ export async function addWorktree(repo, issue, branch, base, remote, start) {
20
20
  const existing = await findWorktree(repo, branch);
21
21
  const path = existing ?? worktreePath(repo, issue);
22
22
  const target = pushed ? upstream : remoteBase;
23
+ if (start) {
24
+ await keepUnmergedCommits(repo, branch, target);
25
+ }
23
26
  if (existing === undefined) {
24
27
  await keepDetachedEdits(path, branch);
25
28
  await succeeds(repo.root, ['worktree', 'remove', '--force', path]);
@@ -42,6 +45,13 @@ async function keepDetachedEdits(path, branch) {
42
45
  }
43
46
  await git(path, ['branch', `${branch}-detached-${(await revision(path)).slice(0, 7)}`]);
44
47
  }
48
+ async function keepUnmergedCommits(repo, branch, target) {
49
+ if (!(await hasBranch(repo, branch)) || (await isAncestor(repo.root, branch, target))) {
50
+ return;
51
+ }
52
+ const head = await git(repo.root, ['rev-parse', branch]);
53
+ await git(repo.root, ['branch', '--force', `${branch}-kept-${head.slice(0, 7)}`, branch]);
54
+ }
45
55
  async function hasWork(repo, branch, pushed, base) {
46
56
  if (!(await hasBranch(repo, branch))) {
47
57
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "17.0.5",
3
+ "version": "17.0.7",
4
4
  "description": "Autonomous issue harness driven by the Claude Agent SDK",
5
5
  "keywords": [
6
6
  "github",