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:
parent
0ae59b7de7
commit
1b10046e1a
2 changed files with 0 additions and 19 deletions
|
@ -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
|
||||
|
|
|
@ -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/", "")
|
||||
|
|
Loading…
Add table
Reference in a new issue