From 979a6df4755a114e38cd1825be40cb07225f1fb4 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Tue, 11 Aug 2015 17:50:38 +0200 Subject: Skip 'git annex init' when using 'gcryptsetup' 'gcryptsetup' is a special git-annex feature that does its own initialization. --- lib/gitlab_shell.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/gitlab_shell.rb') diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb index 57c319c..cbfe468 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]) @@ -174,4 +174,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 -- cgit v1.2.1