diff --git a/.deadcode-out b/.deadcode-out index 3e3bd9968b..811b093fe9 100644 --- a/.deadcode-out +++ b/.deadcode-out @@ -198,9 +198,6 @@ code.gitea.io/gitea/modules/setting GitConfigType.GetOption InitLoggersForTest -code.gitea.io/gitea/modules/structs - ParsePushHook - code.gitea.io/gitea/modules/sync StatusTable.Start StatusTable.IsRunning diff --git a/modules/structs/hook.go b/modules/structs/hook.go index b3fdeb7f17..10b3a9db9b 100644 --- a/modules/structs/hook.go +++ b/modules/structs/hook.go @@ -272,22 +272,6 @@ func (p *PushPayload) JSONPayload() ([]byte, error) { return json.MarshalIndent(p, "", " ") } -// ParsePushHook parses push event hook content. -func ParsePushHook(raw []byte) (*PushPayload, error) { - hook := new(PushPayload) - if err := json.Unmarshal(raw, hook); err != nil { - return nil, err - } - - switch { - case hook.Repo == nil: - return nil, ErrInvalidReceiveHook - case len(hook.Ref) == 0: - return nil, ErrInvalidReceiveHook - } - return hook, nil -} - // Branch returns branch name from a payload func (p *PushPayload) Branch() string { return strings.ReplaceAll(p.Ref, "refs/heads/", "")