Commit 6add3335 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

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
parents 57bc5729 ac814447
v2.6.6 (unreleased)
- Do not clean LANG environment variable for the git hooks when working through the SSH-protocol
- Add git-lfs-authenticate command to white list (this command is used by git-lfs for SSO authentication through SSH-protocol)
- Handle git-annex and gcryptsetup
v2.6.5
- Handle broken symlinks in create-hooks
......
......@@ -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
......@@ -96,6 +96,14 @@ describe GitlabShell do
it 'should init git-annex' do
File.exists?(File.join(tmp_repos_path, 'dzaporozhets/gitlab.git/annex')).should be_true
end
context 'with git-annex-shell gcryptsetup' do
let(:ssh_cmd) { 'git-annex-shell gcryptsetup /~/dzaporozhets/gitlab.git' }
it 'should not init git-annex' do
File.exists?(File.join(tmp_repos_path, 'dzaporozhets/gitlab.git/annex')).should be_false
end
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment