Commit ecac2f11 authored by Lin Jen-Shin's avatar Lin Jen-Shin
parent c1a75c3c
...@@ -26,10 +26,12 @@ class GitOperationService ...@@ -26,10 +26,12 @@ class GitOperationService
oldrev = Gitlab::Git::BLANK_SHA oldrev = Gitlab::Git::BLANK_SHA
with_hooks(ref, newrev, oldrev) do |service| with_hooks(ref, newrev, oldrev) do |service|
# We want to pass the OID of the tag object to the hooks. For an
# annotated tag we don't know that OID until after the tag object
# (raw_tag) is created in the repository. That is why we have to
# update the value after creating the tag object. Only the
# "post-receive" hook will receive the correct value in this case.
raw_tag = repository.rugged.tags.create(tag_name, newrev, options) raw_tag = repository.rugged.tags.create(tag_name, newrev, options)
# If raw_tag is an annotated tag, we'll need to update newrev to point
# to the new revision.
service.newrev = raw_tag.target_id service.newrev = raw_tag.target_id
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment