summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-03-16 10:50:37 +0100
committerJames Lopez <james@jameslopez.es>2016-03-16 10:50:37 +0100
commit8ec968376b73ed634939220d7b0a3e3f2c1f9b72 (patch)
tree59f86884a75c167c25db805fca6f1ad17127dd1f
parent22b36aec8b8e0a49b4b33a11ac5f972e50cbd000 (diff)
downloadgitlab-shell-8ec968376b73ed634939220d7b0a3e3f2c1f9b72.tar.gz
get git annex to work when using custom SSH port
-rw-r--r--lib/gitlab_shell.rb5
-rw-r--r--spec/gitlab_shell_spec.rb10
2 files changed, 11 insertions, 4 deletions
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb
index 96ee1b7..365c543 100644
--- a/lib/gitlab_shell.rb
+++ b/lib/gitlab_shell.rb
@@ -101,9 +101,8 @@ class GitlabShell
parsed_args =
args.map do |arg|
- # Convert /~/group/project.git to group/project.git
- # to make git annex path compatible with gitlab-shell
- if arg =~ /\A\/~\/.*\.git\Z/
+ # use full repo path
+ if arg =~ /\A\/.*\.git\Z/
repo_full_path
else
arg
diff --git a/spec/gitlab_shell_spec.rb b/spec/gitlab_shell_spec.rb
index 86d72f4..c03632e 100644
--- a/spec/gitlab_shell_spec.rb
+++ b/spec/gitlab_shell_spec.rb
@@ -104,6 +104,14 @@ describe GitlabShell do
File.exists?(File.join(tmp_repos_path, 'dzaporozhets/gitlab.git/annex')).should be_false
end
end
+
+ context 'git annex SSH custom port issue' do
+ let(:ssh_args) { %W(git-annex-shell inannex /dzaporozhets/gitlab.git SHA256E) }
+
+ it 'should init git-annex' do
+ File.exists?(File.join(tmp_repos_path, 'dzaporozhets/gitlab.git/annex')).should be_true
+ end
+ end
end
end
@@ -171,7 +179,7 @@ describe GitlabShell do
end
end
- context 'no command' do
+ context 'no command' do
after { subject.exec(nil) }
it "should call api.discover" do