summaryrefslogtreecommitdiff
path: root/app/services/files/create_dir_service.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-09-16 22:45:22 -0700
committerStan Hu <stanhu@gmail.com>2015-10-07 04:22:55 -0700
commit0ab6ca93aadaf08f65f36e7fbdb5b837bac6e160 (patch)
treeb20c01f8a37413e401873e5fd1be5e07865b93ac /app/services/files/create_dir_service.rb
parent0611a18964a998b6edc81ef9b469f9f70430e542 (diff)
downloadgitlab-ce-0ab6ca93aadaf08f65f36e7fbdb5b837bac6e160.tar.gz
Add directory feature button
Change "+" icon under "Files" section to have three options: * Create file * Upload file * New directory Upload file is no longer accessible from the "Create file" page. Users can now select a target branch in upload file as well. Closes #2799: Fixes a bug where file modes were overwritten after a commit Closes https://github.com/gitlabhq/gitlabhq/issues/8253: Existing files can no longer be overwritten in the "Create file" section. Closes #2557
Diffstat (limited to 'app/services/files/create_dir_service.rb')
-rw-r--r--app/services/files/create_dir_service.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/services/files/create_dir_service.rb b/app/services/files/create_dir_service.rb
new file mode 100644
index 00000000000..71272fb5707
--- /dev/null
+++ b/app/services/files/create_dir_service.rb
@@ -0,0 +1,9 @@
+require_relative "base_service"
+
+module Files
+ class CreateDirService < Files::BaseService
+ def commit
+ repository.commit_dir(current_user, @file_path, @commit_message, @target_branch)
+ end
+ end
+end