Post-receive hook can also fire TagPushService

This commit is contained in:
Jeroen van Baarsen 2014-03-05 22:10:35 +01:00
parent 13d2bcc3b4
commit f096bd61bd

View file

@ -29,10 +29,20 @@ class PostReceive
return false return false
end end
if tag?(ref)
GitTagPushService.new.execute(project, user, ref)
else
GitPushService.new.execute(project, user, oldrev, newrev, ref) GitPushService.new.execute(project, user, oldrev, newrev, ref)
end end
end
def log(message) def log(message)
Gitlab::GitLogger.error("POST-RECEIVE: #{message}") Gitlab::GitLogger.error("POST-RECEIVE: #{message}")
end end
private
def tag?(ref)
!!(/refs\/tags\/(.*)/.match(ref))
end
end end