diff options
author | Valery Sizov <valery@gitlab.com> | 2016-07-06 16:26:59 +0300 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2016-07-06 20:58:43 +0300 |
commit | 3baed8cb6ddf9d46b653f17135cbffc8e662cedd (patch) | |
tree | 836cdccc6609d1d9d3a8ba52c76dadc6267fd738 /app/services/files/base_service.rb | |
parent | cfd5870b62e9d76e564ffc64db1d1281b4a363bb (diff) | |
download | gitlab-ce-3baed8cb6ddf9d46b653f17135cbffc8e662cedd.tar.gz |
Services: code style fixes, minor refactoringservices_refactoring1
Diffstat (limited to 'app/services/files/base_service.rb')
-rw-r--r-- | app/services/files/base_service.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/services/files/base_service.rb b/app/services/files/base_service.rb index 4bdb68a3698..37c5e321b39 100644 --- a/app/services/files/base_service.rb +++ b/app/services/files/base_service.rb @@ -15,7 +15,6 @@ module Files params[:file_content] end - # Validate parameters validate # Create new branch if it different from source_branch @@ -26,7 +25,7 @@ module Files if commit success else - error("Something went wrong. Your changes were not committed") + error('Something went wrong. Your changes were not committed') end rescue Repository::CommitError, Gitlab::Git::Repository::InvalidBlobName, GitHooksService::PreReceiveError, ValidationError => ex error(ex.message) @@ -51,12 +50,12 @@ module Files unless project.empty_repo? unless @source_project.repository.branch_names.include?(@source_branch) - raise_error("You can only create or edit files when you are on a branch") + raise_error('You can only create or edit files when you are on a branch') end if different_branch? if repository.branch_names.include?(@target_branch) - raise_error("Branch with such name already exists. You need to switch to this branch in order to make changes") + raise_error('Branch with such name already exists. You need to switch to this branch in order to make changes') end end end |