taskplane 0.21.3 → 0.21.4
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.
|
@@ -1287,6 +1287,23 @@ export async function executeLane(
|
|
|
1287
1287
|
// The task-runner writes .DONE via writeFileSync but never commits it.
|
|
1288
1288
|
if (pollResult.status === "succeeded") {
|
|
1289
1289
|
commitTaskArtifacts(lane, task, laneId);
|
|
1290
|
+
|
|
1291
|
+
// Reset worktree to clean state for the next task on this lane.
|
|
1292
|
+
// Without this, the next worker sees the previous task's modified
|
|
1293
|
+
// files and can get confused about which task it's working on.
|
|
1294
|
+
if (lane.tasks.indexOf(task) < lane.tasks.length - 1) {
|
|
1295
|
+
execLog(laneId, task.taskId, "resetting worktree for next task");
|
|
1296
|
+
const resetResult = runGit(["checkout", "--", "."], lane.worktreePath);
|
|
1297
|
+
const cleanResult = runGit(["clean", "-fd"], lane.worktreePath);
|
|
1298
|
+
if (!resetResult.ok || !cleanResult.ok) {
|
|
1299
|
+
execLog(laneId, task.taskId, "worktree reset warning", {
|
|
1300
|
+
resetOk: resetResult.ok,
|
|
1301
|
+
cleanOk: cleanResult.ok,
|
|
1302
|
+
resetErr: resetResult.stderr,
|
|
1303
|
+
cleanErr: cleanResult.stderr,
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1290
1307
|
}
|
|
1291
1308
|
|
|
1292
1309
|
// If task failed or was paused, skip remaining tasks
|