0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-05-18 12:15:11 +02:00

Fix LFS tests, git-lfs not initialized/installed

This commit is contained in:
DmitryFrolovTri 2026-01-22 12:59:46 +00:00
parent 303cb6f930
commit 902829d4db

View File

@ -163,7 +163,10 @@ func testLFSSizeLimitInternal(t *testing.T, u *url.URL) {
// Helper to track LFS
setupLFS := func(t *testing.T, dstPath string) {
err := os.WriteFile(path.Join(dstPath, ".gitattributes"), []byte("*.dat filter=lfs diff=lfs merge=lfs -text\n"), 0o644)
// Initialize git-lfs in the repository
err := gitcmd.NewCommand("lfs", "install", "--local").WithDir(dstPath).Run(t.Context())
assert.NoError(t, err)
err = os.WriteFile(path.Join(dstPath, ".gitattributes"), []byte("*.dat filter=lfs diff=lfs merge=lfs -text\n"), 0o644)
assert.NoError(t, err)
err = gitcmd.NewCommand("add", ".gitattributes").WithDir(dstPath).Run(t.Context())
assert.NoError(t, err)