Version checks include the branch

This commit is contained in:
Neil Lalonde
2014-09-09 17:04:10 -04:00
parent b2460d7395
commit 19cba7bb0f
2 changed files with 11 additions and 2 deletions

View File

@ -201,6 +201,16 @@ module Discourse
end
end
def self.git_branch
return $git_branch if $git_branch
begin
$git_branch ||= `git rev-parse --abbrev-ref HEAD`.strip
rescue
$git_branch = "unknown"
end
end
# Either returns the site_contact_username user or the first admin.
def self.site_contact_user
user = User.find_by(username_lower: SiteSetting.site_contact_username.downcase) if SiteSetting.site_contact_username.present?