From 431e482e3f6f3736328ce4430c44fd58ab1c09d8 Mon Sep 17 00:00:00 2001
From: zeripath <art27@cantab.net>
Date: Fri, 31 Dec 2021 12:33:55 +0000
Subject: [PATCH] Reset the conflicted files list in testpatch (#18139)

Although #18004 will seriously reduce the likelihood of finding
conflicts in the first place - one bug was introduced whereby the
conflicted files status was not being reset properly. This leads to
conflicted PRs remaining conflicted when the conflict has been resolved.

Signed-off-by: Andrew Thornton <art27@cantab.net>
---
 services/pull/patch.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/services/pull/patch.go b/services/pull/patch.go
index 4bc875f630..0eba3f86ed 100644
--- a/services/pull/patch.go
+++ b/services/pull/patch.go
@@ -235,6 +235,7 @@ func checkConflicts(pr *models.PullRequest, gitRepo *git.Repository, tmpBasePath
 	}()
 
 	numberOfConflicts := 0
+	pr.ConflictedFiles = make([]string, 0, 5)
 	conflict := false
 
 	for file := range unmerged {