diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-29 16:37:42 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-29 16:37:42 +0400 |
commit | 6fdd9008272f268b05aa498a79dc200da52f7bbc (patch) | |
tree | 1283fe1d7b648f945e5ca97be2dffbbc911fe922 /app/services | |
parent | ec837932d0296e06ec3d9ca6cf434a62439e39da (diff) | |
parent | 28de31f5200d908551d8372fed7511df80e284fd (diff) |
Merge pull request #7014 from asedge/api_create_tag
Add CreateTagService. Use new service to allow tag creation through API.
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/create_tag_service.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/services/create_tag_service.rb b/app/services/create_tag_service.rb new file mode 100644 index 00000000000..97766677405 --- /dev/null +++ b/app/services/create_tag_service.rb @@ -0,0 +1,13 @@ +class CreateTagService + def execute(project, tag_name, ref, current_user) + repository = project.repository + repository.add_tag(tag_name, ref) + new_tag = repository.find_tag(tag_name) + + if new_tag + Event.create_ref_event(project, current_user, new_tag, 'add', 'refs/tags') + end + + new_tag + end +end |