0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-11 23:30:59 +01:00
gitea/services/pull
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
..
check_test.go Replace assert.Fail with assert.FailNow (#27578) 2023-10-11 11:02:24 +00:00
check.go Abstract hash function usage (#28138) 2023-12-13 21:02:00 +00:00
comment.go Delete issue_service.CreateComment (#26298) 2023-08-04 13:34:34 +00:00
commit_status.go Fix pull request check list is limited (#26179) 2023-07-31 02:21:09 +00:00
edits.go
lfs.go Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
merge_merge.go
merge_prepare.go
merge_rebase.go
merge_squash.go
merge_test.go
merge.go Abstract hash function usage (#28138) 2023-12-13 21:02:00 +00:00
patch_unmerged.go
patch.go Improve ObjectFormat interface (#28496) 2023-12-19 07:20:47 +00:00
pull_test.go
pull.go Adjust object format interface (#28469) 2023-12-17 11:56:08 +00:00
review.go Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
temp_repo.go Adjust object format interface (#28469) 2023-12-17 11:56:08 +00:00
update_rebase.go
update.go