mirror of
https://github.com/go-gitea/gitea.git
synced 2025-04-08 17:05:45 +02:00
Fix recycle dependency
This commit is contained in:
parent
b362ffaa0c
commit
fafd7b73ba
@ -284,7 +284,9 @@ func (repo *Repository) CreateBundle(ctx context.Context, commit string, out io.
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer util.RemoveAll(tmp)
|
||||
defer func() {
|
||||
_ = util.RemoveAll(tmp)
|
||||
}()
|
||||
|
||||
env := append(os.Environ(), "GIT_OBJECT_DIRECTORY="+filepath.Join(repo.Path, "objects"))
|
||||
_, _, err = NewCommand(ctx, "init", "--bare").RunStdString(&RunOpts{Dir: tmp, Env: env})
|
||||
|
@ -11,15 +11,13 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestCopyFile(t *testing.T) {
|
||||
testContent := []byte("hello")
|
||||
|
||||
tmpDir := setting.TempDir()
|
||||
tmpDir := os.TempDir()
|
||||
now := time.Now()
|
||||
srcFile := fmt.Sprintf("%s/copy-test-%d-src.txt", tmpDir, now.UnixMicro())
|
||||
dstFile := fmt.Sprintf("%s/copy-test-%d-dst.txt", tmpDir, now.UnixMicro())
|
||||
|
Loading…
x
Reference in New Issue
Block a user