diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-09-15 23:40:35 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-09-15 23:40:35 +0300 |
commit | e21deaee8ee0d453bf899c1b3fb46262cc60dab9 (patch) | |
tree | 59b04c9cb1c8ce6c510a78ee787fb31817619835 /app/services | |
parent | 7e2dbcbe0915cfd75e91d78e943c153f284df37d (diff) | |
parent | 0ad669bb5ba08d012d3daa50b51a3a6b069e3e83 (diff) |
Merge remote-tracking branch 'origin/master' into ci-and-ce-sitting-in-a-tree-k-i-s-s-i-n-g
# Conflicts:
# Gemfile.lock
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/files/create_service.rb | 4 | ||||
-rw-r--r-- | app/services/projects/create_service.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/services/files/create_service.rb b/app/services/files/create_service.rb index 91d715b2d63..ffbb5993279 100644 --- a/app/services/files/create_service.rb +++ b/app/services/files/create_service.rb @@ -19,10 +19,12 @@ module Files end unless project.empty_repo? + @file_path.slice!(0) if @file_path.start_with?('/') + blob = repository.blob_at_branch(@current_branch, @file_path) if blob - raise_error("Your changes could not be committed, because file with such name exists") + raise_error("Your changes could not be committed because a file with the same name already exists") end end end diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb index 1bb2462565a..e54a13ed6c5 100644 --- a/app/services/projects/create_service.rb +++ b/app/services/projects/create_service.rb @@ -55,9 +55,7 @@ module Projects @project.save if @project.persisted? && !@project.import? - unless @project.create_repository - raise 'Failed to create repository' - end + raise 'Failed to create repository' unless @project.create_repository end end |