From 8527f5b91f517c0bcb0509551a4c9f473746847f Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 1 May 2011 08:10:27 -0700 Subject: [PATCH] A more robust approach to getting the git version. --- lib/compass/version.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/compass/version.rb b/lib/compass/version.rb index 277ac1e2..a9d44288 100644 --- a/lib/compass/version.rb +++ b/lib/compass/version.rb @@ -40,12 +40,12 @@ module Compass def revision_from_git if File.exists?(scope('.git/HEAD')) - rev = File.read(scope('.git/HEAD')).strip - if rev =~ /^ref: (.*)$/ - rev = File.read(scope(".git/#{$1}")).strip + Dir.chdir scope(".") do + `git rev-parse HEAD` end end end + end extend Compass::Version def self.const_missing(const)