Skip to content

Commit 851b54b

Browse files
authored
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 <[email protected]>
1 parent eed8633 commit 851b54b

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)