summaryrefslogtreecommitdiff
path: root/app/services/files/create_dir_service.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-11-17 14:33:35 +0100
committerDouwe Maan <douwe@gitlab.com>2015-11-17 14:33:35 +0100
commit7b014338ca94caf4677a035f28469945e6a80100 (patch)
treec442bdae95edb35d14551ca04052227bdb840511 /app/services/files/create_dir_service.rb
parentbb8b6f38e7fef0afd41088d54d9dda41695ec1c7 (diff)
parent1c040b3f0a3ecb18fc8fdea3cf99b70edad8d873 (diff)
downloadgitlab-ce-contributor-graph-by-email.tar.gz
Merge branch 'master' into contributor-graph-by-emailcontributor-graph-by-email
Diffstat (limited to 'app/services/files/create_dir_service.rb')
-rw-r--r--app/services/files/create_dir_service.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/services/files/create_dir_service.rb b/app/services/files/create_dir_service.rb
index 71272fb5707..6107254a34e 100644
--- a/app/services/files/create_dir_service.rb
+++ b/app/services/files/create_dir_service.rb
@@ -5,5 +5,16 @@ module Files
def commit
repository.commit_dir(current_user, @file_path, @commit_message, @target_branch)
end
+
+ def validate
+ super
+
+ unless @file_path =~ Gitlab::Regex.file_path_regex
+ raise_error(
+ 'Your changes could not be committed, because the file path ' +
+ Gitlab::Regex.file_path_regex_message
+ )
+ end
+ end
end
end