summaryrefslogtreecommitdiffstats
path: root/services/pull/check.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/pull/check.go')
-rw-r--r--services/pull/check.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/services/pull/check.go b/services/pull/check.go
index ea91f3a862..d6817bc81b 100644
--- a/services/pull/check.go
+++ b/services/pull/check.go
@@ -20,6 +20,7 @@ import (
"code.gitea.io/gitea/modules/notification"
"code.gitea.io/gitea/modules/queue"
"code.gitea.io/gitea/modules/timeutil"
+ "code.gitea.io/gitea/modules/util"
"github.com/unknwon/com"
)
@@ -82,7 +83,11 @@ func getMergeCommit(pr *models.PullRequest) (*git.Commit, error) {
if err != nil {
return nil, fmt.Errorf("Failed to create temp dir for repository %s: %v", pr.BaseRepo.RepoPath(), err)
}
- defer os.RemoveAll(indexTmpPath)
+ defer func() {
+ if err := util.RemoveAll(indexTmpPath); err != nil {
+ log.Warn("Unable to remove temporary index path: %s: Error: %v", indexTmpPath, err)
+ }
+ }()
headFile := pr.GetGitRefName()