Commit a1fff682de99618298883742c8cdc169c03c623f
1 parent
6f915d5a
Exists in
master
and in
4 other branches
Add support for custom SSH ports
Showing
2 changed files
with
6 additions
and
1 deletions
Show diff stats
app/models/repository.rb
@@ -22,7 +22,11 @@ class Repository | @@ -22,7 +22,11 @@ class Repository | ||
22 | end | 22 | end |
23 | 23 | ||
24 | def url_to_repo | 24 | def url_to_repo |
25 | - "#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{path}.git" | 25 | + if !GITOSIS["port"] or GITOSIS["port"] == 22 |
26 | + "#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{path}.git" | ||
27 | + else | ||
28 | + "ssh://#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{GITOSIS["port"]}/#{path}.git" | ||
29 | + end | ||
26 | end | 30 | end |
27 | 31 | ||
28 | def path_to_repo | 32 | def path_to_repo |
config/gitosis.yml