Commit 9d913789803a04b76e0ad2cf5a35971f2218305e
Exists in
master
and in
4 other branches
Merge pull request #91 from lukasberns/master
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 | 22 | end |
| 23 | 23 | |
| 24 | 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 | 30 | end |
| 27 | 31 | |
| 28 | 32 | def path_to_repo | ... | ... |
config/gitosis.yml