From cbcb4361d5fa554b707b28055aed33629a34d60c Mon Sep 17 00:00:00 2001
From: Bwko <bouwko@gmail.com>
Date: Thu, 8 Dec 2016 23:08:28 +0100
Subject: [PATCH] Fixes issue #283

Delete old temp local copy before we create a new temp local copy
---
 models/pull.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/models/pull.go b/models/pull.go
index b7a1ce5d2e..9ffbfe0286 100644
--- a/models/pull.go
+++ b/models/pull.go
@@ -429,6 +429,9 @@ func (pr *PullRequest) testPatch() (err error) {
 
 	log.Trace("PullRequest[%d].testPatch (patchPath): %s", pr.ID, patchPath)
 
+	// Delete old temp local copy before we create a new temp local copy
+	RemoveAllWithNotice("Deleting old local copy", pr.BaseRepo.LocalCopyPath())
+
 	if err := pr.BaseRepo.UpdateLocalCopyBranch(pr.BaseBranch); err != nil {
 		return fmt.Errorf("UpdateLocalCopy: %v", err)
 	}