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:
parent
303cb6f930
commit
902829d4db
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user