summaryrefslogtreecommitdiff
path: root/lib/gitlab/git_host.rb
blob: 3d8d17473c5f9e1d29a1c2fa33cac5088ad9119b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require File.join(Rails.root, "lib", "gitlab", "gitolite")

module Gitlab
  class GitHost
    def self.system
      Gitlab::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