From 74bd9691c685942798f2761607731697498ceeae Mon Sep 17 00:00:00 2001 From: zeripath Date: Tue, 11 Aug 2020 21:05:34 +0100 Subject: Re-attempt to delete temporary upload if the file is locked by another process (#12447) Replace all calls to os.Remove/os.RemoveAll by retrying util.Remove/util.RemoveAll and remove circular dependencies from util. Fix #12339 Signed-off-by: Andrew Thornton Co-authored-by: silverwind --- modules/git/commit_info_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/git/commit_info_test.go') diff --git a/modules/git/commit_info_test.go b/modules/git/commit_info_test.go index ef40e4a3ab..8bdf1a769b 100644 --- a/modules/git/commit_info_test.go +++ b/modules/git/commit_info_test.go @@ -10,6 +10,7 @@ import ( "testing" "time" + "code.gitea.io/gitea/modules/util" "github.com/stretchr/testify/assert" ) @@ -87,7 +88,7 @@ func TestEntries_GetCommitsInfo(t *testing.T) { clonedPath, err := cloneRepo(bareRepo1Path, testReposDir, "repo1_TestEntries_GetCommitsInfo") assert.NoError(t, err) - defer os.RemoveAll(clonedPath) + defer util.RemoveAll(clonedPath) clonedRepo1, err := OpenRepository(clonedPath) assert.NoError(t, err) defer clonedRepo1.Close() -- cgit v1.2.3