diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-12-17 19:56:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-17 11:56:08 +0000 |
commit | 408a4842240e7dd906e682196bd4254d6c76fcb9 (patch) | |
tree | ec3962d5769a5891a24b4d79f725673fc1e46e35 /services/migrations/common.go | |
parent | 7fb6b5147038649bfaa26147a6173cf99b322a30 (diff) | |
download | gitea-408a4842240e7dd906e682196bd4254d6c76fcb9.tar.gz gitea-408a4842240e7dd906e682196bd4254d6c76fcb9.zip |
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
Diffstat (limited to 'services/migrations/common.go')
-rw-r--r-- | services/migrations/common.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/services/migrations/common.go b/services/migrations/common.go index 278c156b03..d88518899d 100644 --- a/services/migrations/common.go +++ b/services/migrations/common.go @@ -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 = "" |