0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-02-15 18:48:24 -05:00

chore: Remove ParsePushHook

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

View file

@ -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

View file

@ -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/", "")