Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/files/create_service.rb')
-rw-r--r--app/services/files/create_service.rb4
1 files changed, 3 insertions, 1 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