diff options
author | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2014-03-05 22:10:35 +0100 |
---|---|---|
committer | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2014-03-05 22:10:35 +0100 |
commit | f096bd61bda605f2e3631bcd4663ab68c7396989 (patch) | |
tree | f9ab169838f1abe22b3c435b33c5be1693349cf8 /app/workers | |
parent | 13d2bcc3b4d6141643fe31dc4d7212ebca0612a5 (diff) | |
download | gitlab-ce-f096bd61bda605f2e3631bcd4663ab68c7396989.tar.gz |
Post-receive hook can also fire TagPushService
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/post_receive.rb | 12 |
1 files changed, 11 insertions, 1 deletions
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 |