From 3ec35e1406c0065ac0b69d8eb8c7f1e951e26d7a Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 20 Nov 2019 11:20:49 -0500 Subject: [PATCH] gitsrht-update-hook: skip stage 3 if possible --- gitsrht-update-hook/post-update.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gitsrht-update-hook/post-update.go b/gitsrht-update-hook/post-update.go index 9172698..10fabae 100644 --- a/gitsrht-update-hook/post-update.go +++ b/gitsrht-update-hook/post-update.go @@ -265,6 +265,11 @@ func postUpdate() { logger.Fatal("No post-update script configured, cannot run stage 3") } + if len(deliveries) == 0 && len(dbinfo.AsyncWebhooks) == 0 { + logger.Println("Skipping stage 3, no work") + return + } + // Run stage 3 asyncronously - the last few tasks can be done without // blocking the pusher's terminal. stage3 := exec.Command(hook, string(deliveriesJson), string(payloadBytes)) -- 2.38.4