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.
gitea/services
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.
1 year ago
..
actions Improve ObjectFormat interface (#28496) 1 year ago
agit Adjust object format interface (#28469) 1 year ago
asymkey Use db.Find instead of writing methods for every object (#28084) 1 year ago
attachment Even more `db.DefaultContext` refactor (#27352) 1 year ago
auth Deprecate query string auth tokens (#28390) 1 year ago
automerge
context
convert Adjust object format interface (#28469) 1 year ago
cron Update go dependencies (#28518) 1 year ago
externalaccount Final round of `db.DefaultContext` refactor (#27587) 1 year ago
feed More `db.DefaultContext` refactor (#27265) 1 year ago
forms Adjust object format interface (#28469) 1 year ago
gitdiff Add option to disable ambiguous unicode characters detection (#28454) 1 year ago
indexer Fix missing issue search index update when changing status (#28325) 1 year ago
issue Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
lfs Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 1 year ago
mailer Fix missing mail reply address (#27997) 1 year ago
markup make writing main test easier (#27270) 1 year ago
migrations Bump google/go-github to v57 (#28514) 1 year ago
mirror Adjust object format interface (#28469) 1 year ago
notify
org Delete repos of org when purge delete user (#27273) 1 year ago
packages Adjust object format interface (#28469) 1 year ago
pull Improve ObjectFormat interface (#28496) 1 year ago
release Adjust object format interface (#28469) 1 year ago
repository Adjust object format interface (#28469) 1 year ago
secrets Use db.Find instead of writing methods for every object (#28084) 1 year ago
task Fix incorrect ctx usage in defer function (#27740) 1 year ago
uinotification Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
user Use db.Find instead of writing methods for every object (#28084) 1 year ago
webhook Abstract hash function usage (#28138) 1 year ago
wiki Adjust object format interface (#28469) 1 year ago