Skip to content

Commit 6add333

Browse files
committed
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
2 parents 57bc572 + ac81444 commit 6add333

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
v2.6.6 (unreleased)
22
- Do not clean LANG environment variable for the git hooks when working through the SSH-protocol
33
- Add git-lfs-authenticate command to white list (this command is used by git-lfs for SSO authentication through SSH-protocol)
4+
- Handle git-annex and gcryptsetup
45

56
v2.6.5
67
- Handle broken symlinks in create-hooks

lib/gitlab_shell.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def parse_cmd
6767
@repo_name = escape_path(args[2].sub(/\A\/~\//, ''))
6868

6969
# Make sure repository has git-annex enabled
70-
init_git_annex(@repo_name)
70+
init_git_annex(@repo_name) unless gcryptsetup?(args)
7171
when 'git-lfs-authenticate'
7272
raise DisallowedCommandError unless args.count >= 2
7373
@repo_name = escape_path(args[1])
@@ -177,4 +177,9 @@ def init_git_annex(path)
177177
$logger.info "Enable git-annex for repository: #{path}."
178178
end
179179
end
180+
181+
def gcryptsetup?(args)
182+
non_dashed = args.reject { |a| a.start_with?('-') }
183+
non_dashed[0, 2] == %w{git-annex-shell gcryptsetup}
184+
end
180185
end

spec/gitlab_shell_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@
9696
it 'should init git-annex' do
9797
File.exists?(File.join(tmp_repos_path, 'dzaporozhets/gitlab.git/annex')).should be_true
9898
end
99+
100+
context 'with git-annex-shell gcryptsetup' do
101+
let(:ssh_cmd) { 'git-annex-shell gcryptsetup /~/dzaporozhets/gitlab.git' }
102+
103+
it 'should not init git-annex' do
104+
File.exists?(File.join(tmp_repos_path, 'dzaporozhets/gitlab.git/annex')).should be_false
105+
end
106+
end
99107
end
100108
end
101109

0 commit comments

Comments
 (0)