mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-25 23:06:11 +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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer util.RemoveAll(tmp)
|
defer func() {
|
||||||
|
_ = util.RemoveAll(tmp)
|
||||||
|
}()
|
||||||
|
|
||||||
env := append(os.Environ(), "GIT_OBJECT_DIRECTORY="+filepath.Join(repo.Path, "objects"))
|
env := append(os.Environ(), "GIT_OBJECT_DIRECTORY="+filepath.Join(repo.Path, "objects"))
|
||||||
_, _, err = NewCommand(ctx, "init", "--bare").RunStdString(&RunOpts{Dir: tmp, Env: env})
|
_, _, err = NewCommand(ctx, "init", "--bare").RunStdString(&RunOpts{Dir: tmp, Env: env})
|
||||||
|
@ -11,15 +11,13 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"code.gitea.io/gitea/modules/setting"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCopyFile(t *testing.T) {
|
func TestCopyFile(t *testing.T) {
|
||||||
testContent := []byte("hello")
|
testContent := []byte("hello")
|
||||||
|
|
||||||
tmpDir := setting.TempDir()
|
tmpDir := os.TempDir()
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
srcFile := fmt.Sprintf("%s/copy-test-%d-src.txt", tmpDir, now.UnixMicro())
|
srcFile := fmt.Sprintf("%s/copy-test-%d-src.txt", tmpDir, now.UnixMicro())
|
||||||
dstFile := fmt.Sprintf("%s/copy-test-%d-dst.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