summaryrefslogtreecommitdiff
path: root/lib/gitlab_shell.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-16 08:58:18 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-16 08:58:18 -0800
commitdb77a6120745364036512c31b93428cd0714b884 (patch)
tree5790bd7b1ee542641ae3a44dd7e902cf07298639 /lib/gitlab_shell.rb
parent487b1bf271907e04701fd8a750d194a5b06eb4c0 (diff)
downloadgitlab-shell-db77a6120745364036512c31b93428cd0714b884.tar.gz
Add config option to disable git-annex
Diffstat (limited to 'lib/gitlab_shell.rb')
-rw-r--r--lib/gitlab_shell.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb
index 98a5cbc..ed25e07 100644
--- a/lib/gitlab_shell.rb
+++ b/lib/gitlab_shell.rb
@@ -50,11 +50,11 @@ class GitlabShell
args = Shellwords.shellwords(@origin_cmd)
@git_cmd = args.first
- if @git_cmd == 'git-annex-shell'
+ if @git_cmd == 'git-annex-shell' && @config.git_annex_enabled?
@repo_name = escape_path(args[2].gsub("\/~\/", ''))
# Make sure repository has git-annex enabled
- enable_git_annex(@repo_name)
+ init_git_annex(@repo_name)
else
raise DisallowedCommandError unless args.count == 2
@repo_name = escape_path(args.last)
@@ -68,7 +68,7 @@ class GitlabShell
def process_cmd
repo_full_path = File.join(repos_path, repo_name)
- if @git_cmd == 'git-annex-shell'
+ if @git_cmd == 'git-annex-shell' && @config.git_annex_enabled?
args = Shellwords.shellwords(@origin_cmd)
parsed_args =
args.map do |arg|
@@ -127,7 +127,7 @@ class GitlabShell
end
end
- def enable_git_annex(path)
+ def init_git_annex(path)
full_repo_path = File.join(repos_path, path)
unless File.exists?(File.join(full_repo_path, '.git', 'annex'))