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:
authorliyakun <liyakun127@gmail.com>2015-09-10 17:18:40 +0300
committerliyakun <liyakun127@gmail.com>2015-09-15 03:12:56 +0300
commite2ece2bc350bf881e9716e51c01a59eecac65fc9 (patch)
tree422d043e1cd6bc09c62fd726958384c320c483d8 /app/services
parent7abb744eb961d95ef9f34e8b64c47084d3f620b6 (diff)
Add "Replace" and "Upload" features
Refactor upload and replace functionality Rename file and move CSS Fix typo Make dropzone a div Remove unnecessary file Change color of "upload existing one" Add missing changes
Diffstat (limited to 'app/services')
-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