forgejo/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
activitypub Upgrade to golangci-lint@v1.55.0 (#27756) 2023-10-24 02:54:59 +00:00
analyze
assetfs
auth
avatar
base
cache
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 Replace assert.Fail with assert.FailNow (#27578) 2023-10-11 11:02:24 +00:00
csv
doctor Add orphaned topic consistency check (#28507) 2023-12-18 15:32:08 +00:00
emoji
eventsource Final round of db.DefaultContext refactor (#27587) 2023-10-14 08:37:24 +00:00
generate
git Improve ObjectFormat interface (#28496) 2023-12-19 07:20:47 +00:00
gitgraph More db.DefaultContext refactor (#27265) 2023-09-29 12:12:54 +00:00
graceful Refactor graceful manager to use shared code (#28073) 2023-11-24 14:21:46 +00:00
hcaptcha
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 Replace assert.Fail with assert.FailNow (#27578) 2023-10-11 11:02:24 +00:00
proxy
proxyprotocol
public
queue Increase queue length (#27555) 2023-10-10 18:47:49 +08:00
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
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