fix: Fix the panic when ssh remote lfs endpoint parsing failure (#38026) (#38158)

Fix #38016
Backport #38026
This commit is contained in:
Lunny Xiao
2026-06-18 11:34:58 +03:00
committed by GitHub
parent 6fb96fcfdf
commit 0b9623e188
7 changed files with 74 additions and 12 deletions
+4 -2
View File
@@ -159,8 +159,10 @@ func MigrateRepositoryGitData(ctx context.Context, u *user_model.User,
}
if opts.LFS {
endpoint := lfs.DetermineEndpoint(opts.CloneAddr, opts.LFSEndpoint)
lfsClient := lfs.NewClient(endpoint, httpTransport)
lfsClient, err := lfs.NewClientFromEndpoint(opts.CloneAddr, opts.LFSEndpoint, httpTransport)
if err != nil {
return repo, fmt.Errorf("NewClientFromEndpoint: %w", err)
}
if err = repo_module.StoreMissingLfsObjectsInRepository(ctx, repo, gitRepo, lfsClient); err != nil {
log.Error("Failed to store missing LFS objects for repository: %v", err)
return repo, fmt.Errorf("StoreMissingLfsObjectsInRepository: %w", err)