]> source.dussan.org Git - gitea.git/commitdiff
Correctly upload LFS files (#18316)
authorzeripath <art27@cantab.net>
Tue, 18 Jan 2022 07:44:30 +0000 (07:44 +0000)
committerGitHub <noreply@github.com>
Tue, 18 Jan 2022 07:44:30 +0000 (07:44 +0000)
We need to use the cached .gitattributes file for checking if a file
should be stored in the lfs.

Fix #18297

Signed-off-by: Andrew Thornton <art27@cantab.net>
services/repository/files/update.go
services/repository/files/upload.go

index 0e012e16bcd479b57f30fe12baf7ed5e63c19b73..9fb074ed3947a7dc65c15b59e9afc88f7df59dd9 100644 (file)
@@ -353,6 +353,7 @@ func CreateOrUpdateRepoFile(repo *repo_model.Repository, doer *user_model.User,
                filename2attribute2info, err := t.gitRepo.CheckAttribute(git.CheckAttributeOpts{
                        Attributes: []string{"filter"},
                        Filenames:  []string{treePath},
+                       CachedOnly: true,
                })
                if err != nil {
                        return nil, err
index 5e9c936113482440cfb21840bda7303d48c7221b..28ed461fdc9374bd04ffdac87b87bb7ea89e9540 100644 (file)
@@ -97,6 +97,7 @@ func UploadRepoFiles(repo *repo_model.Repository, doer *user_model.User, opts *U
                filename2attribute2info, err = t.gitRepo.CheckAttribute(git.CheckAttributeOpts{
                        Attributes: []string{"filter"},
                        Filenames:  names,
+                       CachedOnly: true,
                })
                if err != nil {
                        return err