Add a comment to explain why newrev should be updated

Feedback:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7237#note_20301332
This commit is contained in:
Lin Jen-Shin 2017-01-04 22:31:06 +08:00
parent 104bac3d21
commit 14c4db2ae4

View file

@ -1,4 +1,3 @@
class GitOperationService
attr_reader :user, :repository
@ -28,6 +27,9 @@ class GitOperationService
with_hooks(ref, newrev, oldrev) do |service|
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
end
end