0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-25 16:04:42 +01:00
gitea/routers/web
Lunny Xiao 4eb2a29910
Improve ObjectFormat interface (#28496)
The 4 functions are duplicated, especially as interface methods. I think
we just need to keep `MustID` the only one and remove other 3.

```
MustID(b []byte) ObjectID
MustIDFromString(s string) ObjectID
NewID(b []byte) (ObjectID, error)
NewIDFromString(s string) (ObjectID, error)
```

Introduced the new interfrace method `ComputeHash` which will replace
the interface `HasherInterface`. Now we don't need to keep two
interfaces.

Reintroduced `git.NewIDFromString` and `git.MustIDFromString`. The new
function will detect the hash length to decide which objectformat of it.
If it's 40, then it's SHA1. If it's 64, then it's SHA256. This will be
right if the commitID is a full one. So the parameter should be always a
full commit id.

@AdamMajer Please review.
2023-12-19 07:20:47 +00:00
..
admin Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
auth Refactor Find Sources and fix bug when view a user who belongs to an unactive auth source (#27798) 2023-11-03 01:41:00 +00:00
devtest
events
explore Allow to set explore page default sort (#27951) 2023-11-09 10:11:45 +00:00
feed
healthcheck
misc Make CORS work for oauth2 handlers (#28184) 2023-11-23 21:19:26 +08:00
org Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
repo Improve ObjectFormat interface (#28496) 2023-12-19 07:20:47 +00:00
shared Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
user Second part of refactor db.Find (#28194) 2023-12-11 16:56:48 +08:00
base.go
githttp.go Fix http protocol auth (#27875) 2023-11-02 22:14:33 +08:00
goget.go
home.go
metrics.go
nodeinfo.go
swagger_json.go
web.go Do some missing checks (#28423) 2023-12-12 05:01:17 +00:00
webfinger.go