Skip to content

Commit d5ca8f3

Browse files
zeripathStelios Malathouras
authored and
Stelios Malathouras
committedMar 28, 2022
Correctly upload LFS files (go-gitea#18316)
We need to use the cached .gitattributes file for checking if a file should be stored in the lfs. Fix go-gitea#18297 Signed-off-by: Andrew Thornton <art27@cantab.net>
1 parent 3634933 commit d5ca8f3

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed
 

‎services/repository/files/update.go

+1
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ func CreateOrUpdateRepoFile(repo *repo_model.Repository, doer *user_model.User,
353353
filename2attribute2info, err := t.gitRepo.CheckAttribute(git.CheckAttributeOpts{
354354
Attributes: []string{"filter"},
355355
Filenames: []string{treePath},
356+
CachedOnly: true,
356357
})
357358
if err != nil {
358359
return nil, err

‎services/repository/files/upload.go

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ func UploadRepoFiles(repo *repo_model.Repository, doer *user_model.User, opts *U
9797
filename2attribute2info, err = t.gitRepo.CheckAttribute(git.CheckAttributeOpts{
9898
Attributes: []string{"filter"},
9999
Filenames: names,
100+
CachedOnly: true,
100101
})
101102
if err != nil {
102103
return err

0 commit comments

Comments
 (0)
Please sign in to comment.