-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Fix LFS file not stored in LFS when uploaded/edited via API or web UI #34367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Take a look at the original implementation. It will read the git worktree rather than a PASSing |
I've re-added the option to use |
Can we always use |
|
services/repository/files/upload.go
Outdated
@@ -107,10 +107,12 @@ func UploadRepoFiles(ctx context.Context, repo *repo_model.Repository, doer *use | |||
} | |||
|
|||
var attributesMap map[string]*attribute.Attributes | |||
if setting.LFS.StartServer { | |||
if setting.LFS.StartServer && hasOldBranch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the hasOldBranch
still necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I am sure that we should not check hasOldBranch
, because the "upload" should work on an empty repo, which doesn't have "old branch", while some "global gitattributes or info gitattributes" may exist.
Files that should be stored in LFS and are uploaded/edited from the API or web UI aren't stored in LFS. This may be a regression from #34154.