Skip to content

Commit fdb87b0

Browse files
committed
state pull should use the already-merged commit's build script instead of attempting a merge.
There will be no strategy, and lead to a nil-pointer exception.
1 parent c10ecc4 commit fdb87b0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

internal/runners/pull/pull.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,10 @@ func (p *Pull) mergeBuildScript(remoteCommit, localCommit strfmt.UUID) error {
278278
// Compute the merge strategy.
279279
strategies, err := model.MergeCommit(remoteCommit, localCommit)
280280
if err != nil {
281-
switch {
282-
case errors.Is(err, model.ErrMergeFastForward):
281+
if errors.Is(err, model.ErrMergeFastForward) || errors.Is(err, model.ErrMergeCommitInHistory) {
283282
return buildscript_runbit.Update(p.project, scriptB)
284-
case !errors.Is(err, model.ErrMergeCommitInHistory):
285-
return locale.WrapError(err, "err_mergecommit", "Could not detect if merge is necessary.")
286283
}
284+
return locale.WrapError(err, "err_mergecommit", "Could not detect if merge is necessary.")
287285
}
288286

289287
// Attempt the merge.

0 commit comments

Comments
 (0)