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/git
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
..
branch.go Also sync DB branches on push if necessary (#28361) 1 year ago
branch_list.go Second part of refactor `db.Find` (#28194) 1 year ago
branch_test.go Improve ObjectFormat interface (#28496) 1 year ago
commit_status.go Improve ObjectFormat interface (#28496) 1 year ago
commit_status_test.go Restore warning commit status (#27504) 1 year ago
lfs.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
lfs_lock.go Introduce path Clean/Join helper functions (#23495) 2 years ago
main_test.go make writing main test easier (#27270) 1 year ago
protected_banch_list_test.go Fix branch protection priority (#24045) 2 years ago
protected_branch.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
protected_branch_list.go Sync branches into databases (#22743) 2 years ago
protected_branch_test.go Supports wildcard protected branch (#20825) 2 years ago
protected_tag.go Use context parameter in models/git (#22367) 2 years ago
protected_tag_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago