A more robust approach to getting the git version.

This commit is contained in:
Chris Eppstein 2011-05-01 08:10:27 -07:00
parent 7d90dfe4a0
commit 8527f5b91f

View File

@ -40,12 +40,12 @@ module Compass
def revision_from_git def revision_from_git
if File.exists?(scope('.git/HEAD')) if File.exists?(scope('.git/HEAD'))
rev = File.read(scope('.git/HEAD')).strip Dir.chdir scope(".") do
if rev =~ /^ref: (.*)$/ `git rev-parse HEAD`
rev = File.read(scope(".git/#{$1}")).strip
end end
end end
end end
end end
extend Compass::Version extend Compass::Version
def self.const_missing(const) def self.const_missing(const)