Post-receive hook can also fire TagPushService
This commit is contained in:
parent
13d2bcc3b4
commit
f096bd61bd
1 changed files with 11 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue