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/routers/web/repo
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 Only check online runner when detecting matching runners in workflows (#28286) 1 year ago
setting Improve ObjectFormat interface (#28496) 1 year ago
activity.go Implement FSFE REUSE for golang files (#21840) 2 years ago
attachment.go Even more `db.DefaultContext` refactor (#27352) 1 year ago
blame.go Add option to disable ambiguous unicode characters detection (#28454) 1 year ago
branch.go Adjust object format interface (#28469) 1 year ago
cherry_pick.go Upgrade to golangci-lint@v1.55.0 (#27756) 1 year ago
commit.go Abstract hash function usage (#28138) 1 year ago
compare.go Adjust object format interface (#28469) 1 year ago
download.go Less naked returns (#25713) 2 years ago
editor.go Revert "Fix EOL handling in web editor" (#28101) 1 year ago
editor_test.go Move web/api context related testing function into a separate package (#26859) 1 year ago
find.go Implement FSFE REUSE for golang files (#21840) 2 years ago
githttp.go Adjust object format interface (#28469) 1 year ago
githttp_test.go Fix http protocol auth (#27875) 1 year ago
helper.go Improve tree not found page (#26570) 1 year ago
helper_test.go Make web context initialize correctly for different cases (#26726) 1 year ago
issue.go Second part of refactor `db.Find` (#28194) 1 year ago
issue_content_history.go Fix missing check (#28406) 1 year ago
issue_dependency.go Upgrade to golangci-lint@v1.55.0 (#27756) 1 year ago
issue_label.go Even more `db.DefaultContext` refactor (#27352) 1 year ago
issue_label_test.go Move web/api context related testing function into a separate package (#26859) 1 year ago
issue_lock.go Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
issue_pin.go Fix missing check (#28406) 1 year ago
issue_stopwatch.go Final round of `db.DefaultContext` refactor (#27587) 1 year ago
issue_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
issue_timetrack.go Final round of `db.DefaultContext` refactor (#27587) 1 year ago
issue_watch.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
main_test.go make writing main test easier (#27270) 1 year ago
middlewares.go Fix viewing wiki commit on empty repo (#28040) 1 year ago
migrate.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
milestone.go Second part of refactor `db.Find` (#28194) 1 year ago
packages.go Fix the display of org level badges (#26504) 1 year ago
patch.go Upgrade to golangci-lint@v1.55.0 (#27756) 1 year ago
projects.go Fix comment permissions (#28213) 1 year ago
projects_test.go Move web/api context related testing function into a separate package (#26859) 1 year ago
pull.go Final round of `db.DefaultContext` refactor (#27587) 1 year ago
pull_review.go More `db.DefaultContext` refactor (#27265) 1 year ago
release.go Add missing variable in tag list (#28305) 1 year ago
release_test.go Improvements of releases list and tags list (#25859) 1 year ago
render.go Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
repo.go Adjust object format interface (#28469) 1 year ago
search.go Refactor indexer (#25174) 2 years ago
topic.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
treelist.go Implement FSFE REUSE for golang files (#21840) 2 years ago
view.go Add option to disable ambiguous unicode characters detection (#28454) 1 year ago
view_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
wiki.go Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
wiki_test.go Move web/api context related testing function into a separate package (#26859) 1 year ago