File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -144,12 +144,21 @@ func (x *executor) do(ctx context.Context, task *Task) (err error) {
144144 if result , err = x .cache .Get (ctx , cacheKey ); err != nil {
145145 err = errors .Wrapf (err , "checking cache for %q" , task .Repository .Name )
146146 return
147- } else if result != nil && len (result .Commits ) == 1 {
147+ }
148+ if result != nil {
148149 // Build a new changeset spec. We don't want to use `result` as is,
149150 // because the changesetTemplate may have changed. In that case
150151 // the diff would still be valid, so we take it from the cache,
151152 // but we still build a new ChangesetSpec from the task.
152- diff := result .Commits [0 ].Diff
153+ var diff string
154+
155+ if len (result .Commits ) > 1 {
156+ panic ("campaigns currently lack support for multiple commits per changeset" )
157+ }
158+ if len (result .Commits ) == 1 {
159+ diff = result .Commits [0 ].Diff
160+ }
161+
153162 spec := createChangesetSpec (task , diff )
154163
155164 status .Cached = true
You can’t perform that action at this time.
0 commit comments