diff options
author | zeripath <art27@cantab.net> | 2022-01-18 07:44:30 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 07:44:30 +0000 |
commit | 851b54ba9fb80b47367071cf671872c881c6ae6e (patch) | |
tree | f404f3aa9d6f2702bcd0b22ef2a873b28db075bc /services/repository | |
parent | eed8633fb0e95da925e39085c6a85e740b36e98e (diff) | |
download | gitea-851b54ba9fb80b47367071cf671872c881c6ae6e.tar.gz gitea-851b54ba9fb80b47367071cf671872c881c6ae6e.zip |
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>
Diffstat (limited to 'services/repository')
-rw-r--r-- | services/repository/files/update.go | 1 | ||||
-rw-r--r-- | services/repository/files/upload.go | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/services/repository/files/update.go b/services/repository/files/update.go index 0e012e16bc..9fb074ed39 100644 --- a/services/repository/files/update.go +++ b/services/repository/files/update.go @@ -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 diff --git a/services/repository/files/upload.go b/services/repository/files/upload.go index 5e9c936113..28ed461fdc 100644 --- a/services/repository/files/upload.go +++ b/services/repository/files/upload.go @@ -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 |