From 998c6a7a887dc5e29bf6254734e93314511aea8e Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 20 Nov 2019 10:31:38 -0500 Subject: [PATCH] Fix post-update webhook payload --- gitsrht-update-hook/types.go | 13 ------------- gitsrht-update-hook/webhooks.go | 13 +++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gitsrht-update-hook/types.go b/gitsrht-update-hook/types.go index 8bf0616..efe1429 100644 --- a/gitsrht-update-hook/types.go +++ b/gitsrht-update-hook/types.go @@ -54,19 +54,6 @@ type Commit struct { Signature *CommitSignature `json:"signature"` } -type UpdatedRef struct { - Tag *AnnotatedTag `json:"annotated_tag",omitempty` - Name string `json:"name"` - Old *Commit `json:"old"` - New *Commit `json:"commit"` -} - -type WebhookPayload struct { - Push string `json:"push"` - Pusher UserContext `json:"pusher"` - Refs []UpdatedRef `json:"refs"` -} - func GitCommitToWebhookCommit(c *object.Commit) *Commit { parents := make([]string, len(c.ParentHashes)) for i, p := range c.ParentHashes { diff --git a/gitsrht-update-hook/webhooks.go b/gitsrht-update-hook/webhooks.go index ea013af..ac68eda 100644 --- a/gitsrht-update-hook/webhooks.go +++ b/gitsrht-update-hook/webhooks.go @@ -42,6 +42,19 @@ type WebhookDelivery struct { Url string } +type UpdatedRef struct { + Tag *AnnotatedTag `json:"annotated_tag",omitempty` + Name string `json:"name"` + Old *Commit `json:"old"` + New *Commit `json:"new"` +} + +type WebhookPayload struct { + Push string `json:"push"` + Pusher UserContext `json:"pusher"` + Refs []UpdatedRef `json:"refs"` +} + func initWebhookKey() { b64key, ok := config.Get("webhooks", "private-key") if !ok { -- 2.38.4