summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/repository.rb6
-rw-r--r--config/gitosis.yml1
2 files changed, 6 insertions, 1 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index c01320e81d0..3b09471596c 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -22,7 +22,11 @@ class Repository
end
def url_to_repo
- "#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{path}.git"
+ if !GITOSIS["port"] or GITOSIS["port"] == 22
+ "#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{path}.git"
+ else
+ "ssh://#{GITOSIS["git_user"]}@#{GITOSIS["host"]}:#{GITOSIS["port"]}/#{path}.git"
+ end
end
def path_to_repo
diff --git a/config/gitosis.yml b/config/gitosis.yml
index cf76f5a2f7e..1e3137e89e6 100644
--- a/config/gitosis.yml
+++ b/config/gitosis.yml
@@ -2,3 +2,4 @@ admin_uri: git@localhost:gitosis-admin.git
base_path: /home/git/repositories/
host: localhost
git_user: git
+# port: 22