gitea/modules
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
..
actions chore(actions): support cron schedule task (#26655) 2023-08-24 03:06:51 +00:00
activitypub Upgrade to golangci-lint@v1.55.0 (#27756) 2023-10-24 02:54:59 +00:00
analyze Rename code_langauge.go to code_language.go (#26377) 2023-08-07 15:00:53 -04:00
assetfs
auth
avatar
base
cache improve unit test for caching (#26185) 2023-07-27 22:24:40 +02:00
charset Add option to disable ambiguous unicode characters detection (#28454) 2023-12-17 14:38:54 +00:00
container
context Abstract hash function usage (#28138) 2023-12-13 21:02:00 +00:00
contexttest
csv
doctor Add orphaned topic consistency check (#28507) 2023-12-18 15:32:08 +00:00
emoji
eventsource
generate
git Improve ObjectFormat interface (#28496) 2023-12-19 07:20:47 +00:00
gitgraph
graceful Refactor graceful manager to use shared code (#28073) 2023-11-24 14:21:46 +00:00
hcaptcha Consume hcaptcha and pwn deps (#22610) 2023-01-29 09:49:51 -06:00
highlight Add option to disable ambiguous unicode characters detection (#28454) 2023-12-17 14:38:54 +00:00
hostmatcher Support allowed hosts for webhook to work with proxy (#27655) 2023-10-18 09:44:36 +00:00
html
httpcache
httplib
indexer Add option to disable ambiguous unicode characters detection (#28454) 2023-12-17 14:38:54 +00:00
issue/template
json
label
lfs Upgrade to golangci-lint@v1.55.0 (#27756) 2023-10-24 02:54:59 +00:00
log
markup Add option to disable ambiguous unicode characters detection (#28454) 2023-12-17 14:38:54 +00:00
mcaptcha
metrics
migration
nosql
options
packages Close all hashed buffers (#27787) 2023-10-25 21:24:24 +02:00
paginator
pprof
private
process
proxy
proxyprotocol
public
queue
recaptcha
references
regexplru
repository Improve ObjectFormat interface (#28496) 2023-12-19 07:20:47 +00:00
secret
session
setting Add option to disable ambiguous unicode characters detection (#28454) 2023-12-17 14:38:54 +00:00
sitemap Fix sitemap (#22272) 2022-12-30 23:31:00 +08:00
ssh Remove SSH workaround (#27893) 2023-11-03 15:21:05 +00:00
storage
structs chore(api): support ignore password if login source type is LDAP for creating user API (#28491) 2023-12-19 02:32:45 +00:00
svg
sync
system Replace more db.DefaultContext (#27628) 2023-10-15 17:46:06 +02:00
templates Render PyPi long description as document (#28272) 2023-12-05 15:02:01 +00:00
test
testlogger
timeutil
translation
turnstile
typesniffer
updatechecker Replace more db.DefaultContext (#27628) 2023-10-15 17:46:06 +02:00
upload
uri
user
util Add option to disable ambiguous unicode characters detection (#28454) 2023-12-17 14:38:54 +00:00
validation
web Make CORS work for oauth2 handlers (#28184) 2023-11-23 21:19:26 +08:00
webhook