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/models
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
activities Use db.Find instead of writing methods for every object (#28084) 1 year ago
admin Next round of `db.DefaultContext` refactor (#27089) 2 years ago
asymkey Retry SSH key verification with additional CRLF if it failed (#28392) 1 year ago
auth Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 1 year ago
avatars Final round of `db.DefaultContext` refactor (#27587) 1 year ago
db Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 1 year ago
dbfs make writing main test easier (#27270) 1 year ago
fixtures Fix comment permissions (#28213) 1 year ago
git Improve ObjectFormat interface (#28496) 1 year ago
issues Add combined index for issue_user.uid and issue_id (#28080) 1 year ago
migrations Add combined index for issue_user.uid and issue_id (#28080) 1 year ago
organization Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 1 year ago
packages Revert "packages: Calculate package size quota using package creator ID instead of owner ID (#28007)" (#28049) 1 year ago
perm Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 1 year ago
project Fix comment permissions (#28213) 1 year ago
pull Add Index to pull_auto_merge.doer_id (#27811) 1 year ago
repo Add orphaned topic consistency check (#28507) 1 year ago
secret Use db.Find instead of writing methods for every object (#28084) 1 year ago
shared/types Display owner of a runner as a tooltip instead of static text (#24377) 2 years ago
system Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 1 year ago
unit Make actions default enabled for newly created repository if global configuraion enabled (#27482) 1 year ago
unittest Upgrade xorm (#27673) 1 year ago
user Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 1 year ago
webhook Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 1 year ago
error.go Sync branches into databases (#22743) 2 years ago
fixture_generation.go Replace more db.DefaultContext (#27628) 1 year ago
fixture_test.go Replace more db.DefaultContext (#27628) 1 year ago
main_test.go make writing main test easier (#27270) 1 year ago
org.go Refactor the function RemoveOrgUser (#27582) 1 year ago
org_team.go Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 1 year ago
org_team_test.go Reduce usage of `db.DefaultContext` (#27073) 2 years ago
org_test.go Replace more db.DefaultContext (#27628) 1 year ago
repo.go Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
repo_test.go Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
repo_transfer.go Next round of `db.DefaultContext` refactor (#27089) 2 years ago
repo_transfer_test.go Next round of `db.DefaultContext` refactor (#27089) 2 years ago