mirror of
https://github.com/go-gitea/gitea
synced 2025-07-16 07:18:37 +00:00
Adjust object format interface (#28469)
- Remove `ObjectFormatID` - Remove function `ObjectFormatFromID`. - Use `Sha1ObjectFormat` directly but not a pointer because it's an empty struct. - Store `ObjectFormatName` in `repository` struct
This commit is contained in:
@@ -49,7 +49,7 @@ func CheckAndEnsureSafePR(pr *base.PullRequest, commonCloneBaseURL string, g bas
|
||||
|
||||
// SECURITY: SHAs Must be a SHA
|
||||
// FIXME: hash only a SHA1
|
||||
CommitType := git.ObjectFormatFromID(git.Sha1)
|
||||
CommitType := git.Sha1ObjectFormat
|
||||
if pr.MergeCommitSHA != "" && !CommitType.IsValid(pr.MergeCommitSHA) {
|
||||
WarnAndNotice("PR #%d in %s has invalid MergeCommitSHA: %s", pr.Number, g, pr.MergeCommitSHA)
|
||||
pr.MergeCommitSHA = ""
|
||||
|
Reference in New Issue
Block a user