summaryrefslogtreecommitdiff
path: root/internal/executor/executor.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/executor/executor.go')
-rw-r--r--internal/executor/executor.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/executor/executor.go b/internal/executor/executor.go
index 22273d9..8dfb196 100644
--- a/internal/executor/executor.go
+++ b/internal/executor/executor.go
@@ -278,6 +278,12 @@ func (p *Pool) executeResume(ctx context.Context, t *task.Task, exec *storage.Ex
t.RepositoryURL = proj.RemoteURL
}
}
+ // Populate BranchName from Story if missing (ADR-007).
+ if t.BranchName == "" && t.StoryID != "" {
+ if story, err := p.store.GetStory(t.StoryID); err == nil && story.BranchName != "" {
+ t.BranchName = story.BranchName
+ }
+ }
err = runner.Run(ctx, t, exec)
exec.EndTime = time.Now().UTC()
@@ -744,6 +750,12 @@ func (p *Pool) execute(ctx context.Context, t *task.Task) {
t.RepositoryURL = proj.RemoteURL
}
}
+ // Populate BranchName from Story if missing (ADR-007).
+ if t.BranchName == "" && t.StoryID != "" {
+ if story, err := p.store.GetStory(t.StoryID); err == nil && story.BranchName != "" {
+ t.BranchName = story.BranchName
+ }
+ }
// Run the task.
err = runner.Run(ctx, t, exec)