@tarcisiopgs/lisa 0.9.4 → 0.9.5
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/index.js +11 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2236,27 +2236,32 @@ ${result.output}
|
|
|
2236
2236
|
ok(`Provider chose repo: ${manifest.repoPath}, branch: ${manifest.branch}`);
|
|
2237
2237
|
const worktreePath = join7(manifest.repoPath, ".worktrees", manifest.branch);
|
|
2238
2238
|
const baseBranch = resolveBaseBranch(config2, manifest.repoPath);
|
|
2239
|
-
const
|
|
2239
|
+
const hasWorktree = existsSync6(worktreePath);
|
|
2240
|
+
const effectiveCwd = hasWorktree ? worktreePath : manifest.repoPath;
|
|
2241
|
+
if (!hasWorktree) {
|
|
2242
|
+
warn(`Worktree not found at ${worktreePath} \u2014 using repo root for git operations`);
|
|
2243
|
+
}
|
|
2244
|
+
const testsPassed = await runTestValidation(effectiveCwd);
|
|
2240
2245
|
if (!testsPassed) {
|
|
2241
2246
|
error(`Tests failed for ${issue.id}. Blocking PR creation.`);
|
|
2242
|
-
await cleanupWorktree(manifest.repoPath, worktreePath);
|
|
2247
|
+
if (hasWorktree) await cleanupWorktree(manifest.repoPath, worktreePath);
|
|
2243
2248
|
cleanupManifest(workspace);
|
|
2244
2249
|
return { success: false, providerUsed: result.providerUsed, prUrls: [], fallback: result };
|
|
2245
2250
|
}
|
|
2246
2251
|
try {
|
|
2247
|
-
await execa3("git", ["push", "-u", "origin", manifest.branch], { cwd:
|
|
2252
|
+
await execa3("git", ["push", "-u", "origin", manifest.branch], { cwd: effectiveCwd });
|
|
2248
2253
|
} catch (err) {
|
|
2249
2254
|
error(
|
|
2250
2255
|
`Failed to push branch to remote: ${err instanceof Error ? err.message : String(err)}`
|
|
2251
2256
|
);
|
|
2252
|
-
await cleanupWorktree(manifest.repoPath, worktreePath);
|
|
2257
|
+
if (hasWorktree) await cleanupWorktree(manifest.repoPath, worktreePath);
|
|
2253
2258
|
cleanupManifest(workspace);
|
|
2254
2259
|
return { success: false, providerUsed: result.providerUsed, prUrls: [], fallback: result };
|
|
2255
2260
|
}
|
|
2256
2261
|
const prTitle = manifest.prTitle ?? issue.title;
|
|
2257
2262
|
const prUrls = [];
|
|
2258
2263
|
try {
|
|
2259
|
-
const repoInfo = await getRepoInfo(
|
|
2264
|
+
const repoInfo = await getRepoInfo(effectiveCwd);
|
|
2260
2265
|
const pr = await createPullRequest(
|
|
2261
2266
|
{
|
|
2262
2267
|
owner: repoInfo.owner,
|
|
@@ -2274,7 +2279,7 @@ ${result.output}
|
|
|
2274
2279
|
error(`Failed to create PR: ${err instanceof Error ? err.message : String(err)}`);
|
|
2275
2280
|
}
|
|
2276
2281
|
cleanupManifest(workspace);
|
|
2277
|
-
await cleanupWorktree(manifest.repoPath, worktreePath);
|
|
2282
|
+
if (hasWorktree) await cleanupWorktree(manifest.repoPath, worktreePath);
|
|
2278
2283
|
ok(`Session ${session} complete for ${issue.id}`);
|
|
2279
2284
|
return { success: true, providerUsed: result.providerUsed, prUrls, fallback: result };
|
|
2280
2285
|
}
|