summaryrefslogtreecommitdiff
path: root/lib/gitlab_shell.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-10-01 09:50:40 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-10-01 09:50:40 +0000
commit6add33352316af566cec5d827981f1783c59b7f4 (patch)
treee4d4da632a7cb75497982abe52745d2eb1738b61 /lib/gitlab_shell.rb
parent57bc57298c64f40a0a851e474b3e6de91a551ec5 (diff)
parentac814447cbf1da9f65299a96fb787fc6bb3ce2e6 (diff)
downloadgitlab-shell-6add33352316af566cec5d827981f1783c59b7f4.tar.gz
Merge branch 'no-init-on-gcryptsetup' into 'master'
Skip 'git annex init' when using 'gcryptsetup' 'gcryptsetup' is a special git-annex feature that does its own initialization. See merge request !18
Diffstat (limited to 'lib/gitlab_shell.rb')
-rw-r--r--lib/gitlab_shell.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb
index cae501a..4bc1cd7 100644
--- a/lib/gitlab_shell.rb
+++ b/lib/gitlab_shell.rb
@@ -67,7 +67,7 @@ class GitlabShell
@repo_name = escape_path(args[2].sub(/\A\/~\//, ''))
# Make sure repository has git-annex enabled
- init_git_annex(@repo_name)
+ init_git_annex(@repo_name) unless gcryptsetup?(args)
when 'git-lfs-authenticate'
raise DisallowedCommandError unless args.count >= 2
@repo_name = escape_path(args[1])
@@ -177,4 +177,9 @@ class GitlabShell
$logger.info "Enable git-annex for repository: #{path}."
end
end
+
+ def gcryptsetup?(args)
+ non_dashed = args.reject { |a| a.start_with?('-') }
+ non_dashed[0, 2] == %w{git-annex-shell gcryptsetup}
+ end
end