diff options
Diffstat (limited to 'lib/gitlabhq/git_host.rb')
-rw-r--r-- | lib/gitlabhq/git_host.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/gitlabhq/git_host.rb b/lib/gitlabhq/git_host.rb index 714d92f537a..9a6eecb3f0a 100644 --- a/lib/gitlabhq/git_host.rb +++ b/lib/gitlabhq/git_host.rb @@ -1,18 +1,21 @@ require File.join(Rails.root, "lib", "gitlabhq", "gitolite") -require File.join(Rails.root, "lib", "gitlabhq", "gitosis") module Gitlabhq class GitHost def self.system - if GIT_HOST["system"] == "gitosis" - Gitlabhq::Gitosis - else - Gitlabhq::Gitolite - end + Gitlabhq::Gitolite end def self.admin_uri GIT_HOST["admin_uri"] end + + def self.url_to_repo(path) + if !GIT_HOST["port"] or GIT_HOST["port"] == 22 + "#{GIT_HOST["git_user"]}@#{GIT_HOST["host"]}:#{path}.git" + else + "ssh://#{GIT_HOST["git_user"]}@#{GIT_HOST["host"]}:#{GIT_HOST["port"]}/#{path}.git" + end + end end end |