From f096bd61bda605f2e3631bcd4663ab68c7396989 Mon Sep 17 00:00:00 2001 From: Jeroen van Baarsen Date: Wed, 5 Mar 2014 22:10:35 +0100 Subject: [PATCH] Post-receive hook can also fire TagPushService --- app/workers/post_receive.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb index 6416aa608ec..80e6368ad2d 100644 --- a/app/workers/post_receive.rb +++ b/app/workers/post_receive.rb @@ -29,10 +29,20 @@ class PostReceive return false end - GitPushService.new.execute(project, user, oldrev, newrev, ref) + if tag?(ref) + GitTagPushService.new.execute(project, user, ref) + else + GitPushService.new.execute(project, user, oldrev, newrev, ref) + end end def log(message) Gitlab::GitLogger.error("POST-RECEIVE: #{message}") end + + private + + def tag?(ref) + !!(/refs\/tags\/(.*)/.match(ref)) + end end