From fdb87b037d41a4f60e69c39ba10d252c4084ba25 Mon Sep 17 00:00:00 2001 From: mitchell Date: Tue, 26 Nov 2024 15:13:09 -0500 Subject: [PATCH] `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. --- internal/runners/pull/pull.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/runners/pull/pull.go b/internal/runners/pull/pull.go index 0e9ea15c92..4048e4097d 100644 --- a/internal/runners/pull/pull.go +++ b/internal/runners/pull/pull.go @@ -278,12 +278,10 @@ func (p *Pull) mergeBuildScript(remoteCommit, localCommit strfmt.UUID) error { // Compute the merge strategy. strategies, err := model.MergeCommit(remoteCommit, localCommit) if err != nil { - switch { - case errors.Is(err, model.ErrMergeFastForward): + if errors.Is(err, model.ErrMergeFastForward) || errors.Is(err, model.ErrMergeCommitInHistory) { return buildscript_runbit.Update(p.project, scriptB) - case !errors.Is(err, model.ErrMergeCommitInHistory): - return locale.WrapError(err, "err_mergecommit", "Could not detect if merge is necessary.") } + return locale.WrapError(err, "err_mergecommit", "Could not detect if merge is necessary.") } // Attempt the merge.