You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
forgejo/modules/repository
wxiaoguang f0ba87fda8
Avatar refactor, move avatar code from `models` to `models.avatars`, remove duplicated code (#17123)
Why this refactor

The goal is to move most files from `models` package to `models.xxx` package. Many models depend on avatar model, so just move this first.

And the existing logic is not clear, there are too many function like `AvatarLink`, `RelAvatarLink`, `SizedRelAvatarLink`, `SizedAvatarLink`, `MakeFinalAvatarURL`, `HashedAvatarLink`, etc. This refactor make everything clear:

* user.AvatarLink()
* user.AvatarLinkWithSize(size)
* avatars.GenerateEmailAvatarFastLink(email, size)
* avatars.GenerateEmailAvatarFinalLink(email, size)

And many duplicated code are deleted in route handler, the handler and the model share the same avatar logic now.
3 years ago
..
adopt.go Move login related structs and functions to models/login (#17093) 3 years ago
archive.go Fix archive error when rename repo or user (#16399) 3 years ago
branch.go [API] Add pagination to ListBranches (#14524) 3 years ago
cache.go Make commit info cancelable (#16032) 3 years ago
check.go DBContext is just a Context (#17100) 3 years ago
commits.go Avatar refactor, move avatar code from `models` to `models.avatars`, remove duplicated code (#17123) 3 years ago
commits_test.go Move db related basic functions to models/db (#17075) 3 years ago
create.go DBContext is just a Context (#17100) 3 years ago
create_test.go Move db related basic functions to models/db (#17075) 3 years ago
fork.go DBContext is just a Context (#17100) 3 years ago
fork_test.go Move db related basic functions to models/db (#17075) 3 years ago
generate.go DBContext is just a Context (#17100) 3 years ago
hooks.go DBContext is just a Context (#17100) 3 years ago
init.go DBContext is just a Context (#17100) 3 years ago
main_test.go Move db related basic functions to models/db (#17075) 3 years ago
push.go Fix a bug on refactoring (#13373) 4 years ago
repo.go Move login related structs and functions to models/login (#17093) 3 years ago
update.go DBContext is just a Context (#17100) 3 years ago