next-issue 17.0.7 → 17.1.0
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/switch-run.mjs
CHANGED
|
@@ -113,6 +113,9 @@ export function statusText(version, progress) {
|
|
|
113
113
|
lines.push(idleLine(progress));
|
|
114
114
|
}
|
|
115
115
|
lines.push(...progress.issues.map(issueLine));
|
|
116
|
+
if (progress.hunt === true) {
|
|
117
|
+
lines.push('hunting for bugs');
|
|
118
|
+
}
|
|
116
119
|
return `${lines.join('\n')}\n`;
|
|
117
120
|
}
|
|
118
121
|
function idleLine(progress) {
|
package/dist/shared/hunt.mjs
CHANGED
package/dist/shared/worktree.mjs
CHANGED
|
@@ -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
|
|
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 (
|
|
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/dist/worker/progress.mjs
CHANGED
|
@@ -24,6 +24,13 @@ export function applyEvent(progress, record) {
|
|
|
24
24
|
const { nextLook: _nextLook, ...rest } = progress;
|
|
25
25
|
return { ...rest, looking: true };
|
|
26
26
|
}
|
|
27
|
+
if (kind === 'hunt.start') {
|
|
28
|
+
return { ...progress, hunt: true };
|
|
29
|
+
}
|
|
30
|
+
if (kind === 'hunt.end') {
|
|
31
|
+
const { hunt: _hunt, ...rest } = progress;
|
|
32
|
+
return rest;
|
|
33
|
+
}
|
|
27
34
|
const issue = record['issue'];
|
|
28
35
|
if (typeof kind !== 'string' || typeof issue !== 'number') {
|
|
29
36
|
return progress;
|