summaryrefslogtreecommitdiff
path: root/makima/src/daemon/task/manager.rs
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/daemon/task/manager.rs')
-rw-r--r--makima/src/daemon/task/manager.rs23
1 files changed, 19 insertions, 4 deletions
diff --git a/makima/src/daemon/task/manager.rs b/makima/src/daemon/task/manager.rs
index 8c5f8d7..1e05978 100644
--- a/makima/src/daemon/task/manager.rs
+++ b/makima/src/daemon/task/manager.rs
@@ -3305,12 +3305,27 @@ impl TaskManager {
task_id: Uuid,
) -> Result<(), DaemonError> {
// Get task's worktree path and branch
+ // If the task shares a supervisor's worktree, use the supervisor's worktree info
let task_info = {
let tasks = self.tasks.read().await;
- tasks.get(&task_id).map(|t| (
- t.worktree.as_ref().map(|w| w.path.clone()),
- t.worktree.as_ref().map(|w| w.branch.clone()),
- ))
+ if let Some(task) = tasks.get(&task_id) {
+ // Check if this task shares a supervisor's worktree
+ if let Some(supervisor_task_id) = task.supervisor_worktree_task_id {
+ // Use the supervisor's worktree
+ tasks.get(&supervisor_task_id).map(|supervisor| (
+ supervisor.worktree.as_ref().map(|w| w.path.clone()),
+ supervisor.worktree.as_ref().map(|w| w.branch.clone()),
+ ))
+ } else {
+ // Use the task's own worktree
+ Some((
+ task.worktree.as_ref().map(|w| w.path.clone()),
+ task.worktree.as_ref().map(|w| w.branch.clone()),
+ ))
+ }
+ } else {
+ None
+ }
};
let (worktree_path, branch) = match task_info {