chore: Remove ParseCreateHook

- Introduced in e378648c79 and removed in
the same commit. No usage.
This commit is contained in:
Gusted 2025-01-31 11:28:09 +01:00
parent 5cc5c877a5
commit 0ae59b7de7
No known key found for this signature in database
GPG key ID: FD821B732837125F
2 changed files with 0 additions and 21 deletions

View file

@ -199,7 +199,6 @@ code.gitea.io/gitea/modules/setting
InitLoggersForTest
code.gitea.io/gitea/modules/structs
ParseCreateHook
ParsePushHook
code.gitea.io/gitea/modules/sync

View file

@ -141,26 +141,6 @@ func (p *CreatePayload) JSONPayload() ([]byte, error) {
return json.MarshalIndent(p, "", " ")
}
// ParseCreateHook parses create event hook content.
func ParseCreateHook(raw []byte) (*CreatePayload, error) {
hook := new(CreatePayload)
if err := json.Unmarshal(raw, hook); err != nil {
return nil, err
}
// it is possible the JSON was parsed, however,
// was not from Gogs (maybe was from Bitbucket)
// So we'll check to be sure certain key fields
// were populated
switch {
case hook.Repo == nil:
return nil, ErrInvalidReceiveHook
case len(hook.Ref) == 0:
return nil, ErrInvalidReceiveHook
}
return hook, nil
}
// ________ .__ __
// \______ \ ____ | | _____/ |_ ____
// | | \_/ __ \| | _/ __ \ __\/ __ \