diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-10 18:09:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-10 18:09:50 +0300 |
commit | de2fb5b82c92c90f90ed67ced45143c04e934fb8 (patch) | |
tree | ff8e5e642580de7bb596d90dd0e7f739f44ca540 /app/services/tags | |
parent | c6a33b298229f9e04933be43d6176c476ef03012 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/tags')
-rw-r--r-- | app/services/tags/create_service.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/services/tags/create_service.rb b/app/services/tags/create_service.rb index 4de6b2d2774..8a7b98ab944 100644 --- a/app/services/tags/create_service.rb +++ b/app/services/tags/create_service.rb @@ -4,7 +4,7 @@ module Tags class CreateService < BaseService def execute(tag_name, target, message) valid_tag = Gitlab::GitRefValidator.validate(tag_name) - return error('Tag name invalid') unless valid_tag + return error('Tag name invalid', 400) unless valid_tag repository = project.repository message = message&.strip @@ -14,7 +14,7 @@ module Tags begin new_tag = repository.add_tag(current_user, tag_name, target, message) rescue Gitlab::Git::Repository::TagExistsError - return error("Tag #{tag_name} already exists") + return error("Tag #{tag_name} already exists", 409) rescue Gitlab::Git::PreReceiveError => ex return error(ex.message) end @@ -24,7 +24,7 @@ module Tags success.merge(tag: new_tag) else - error("Target #{target} is invalid") + error("Target #{target} is invalid", 400) end end end |