mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-07 12:07:10 +02:00
Fix LFS tests, git-lfs not initialized/installed
This commit is contained in:
1 parent
303cb6f930
commit
902829d4db
1 file changed
+4
-1
@@ -163,7 +163,10 @@ func testLFSSizeLimitInternal(t *testing.T, u *url.URL) {
|
|||||||
|
|
||||||
// Helper to track LFS
|
// Helper to track LFS
|
||||||
setupLFS := func(t *testing.T, dstPath string) {
|
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)
|
assert.NoError(t, err)
|
||||||
err = gitcmd.NewCommand("add", ".gitattributes").WithDir(dstPath).Run(t.Context())
|
err = gitcmd.NewCommand("add", ".gitattributes").WithDir(dstPath).Run(t.Context())
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|||||||
Reference in new issue
Block a user