1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-04 08:17:24 -05:00

Correctly upload LFS files (#18316)

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>
This commit is contained in:
zeripath 2022-01-18 07:44:30 +00:00 committed by GitHub
parent eed8633fb0
commit 851b54ba9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -353,6 +353,7 @@ func CreateOrUpdateRepoFile(repo *repo_model.Repository, doer *user_model.User,
filename2attribute2info, err := t.gitRepo.CheckAttribute(git.CheckAttributeOpts{ filename2attribute2info, err := t.gitRepo.CheckAttribute(git.CheckAttributeOpts{
Attributes: []string{"filter"}, Attributes: []string{"filter"},
Filenames: []string{treePath}, Filenames: []string{treePath},
CachedOnly: true,
}) })
if err != nil { if err != nil {
return nil, err return nil, err

View File

@ -97,6 +97,7 @@ func UploadRepoFiles(repo *repo_model.Repository, doer *user_model.User, opts *U
filename2attribute2info, err = t.gitRepo.CheckAttribute(git.CheckAttributeOpts{ filename2attribute2info, err = t.gitRepo.CheckAttribute(git.CheckAttributeOpts{
Attributes: []string{"filter"}, Attributes: []string{"filter"},
Filenames: names, Filenames: names,
CachedOnly: true,
}) })
if err != nil { if err != nil {
return err return err