buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djspie...@apache.org
Subject svn commit: r797501 - in /buildr/trunk: lib/buildr/core/build.rb spec/core/build_spec.rb
Date Fri, 24 Jul 2009 14:44:23 GMT
Author: djspiewak
Date: Fri Jul 24 14:44:22 2009
New Revision: 797501

URL: http://svn.apache.org/viewvc?rev=797501&view=rev
Log:
Should recursively detect Git repository

Modified:
    buildr/trunk/lib/buildr/core/build.rb
    buildr/trunk/spec/core/build_spec.rb

Modified: buildr/trunk/lib/buildr/core/build.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/build.rb?rev=797501&r1=797500&r2=797501&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/build.rb (original)
+++ buildr/trunk/lib/buildr/core/build.rb Fri Jul 24 14:44:22 2009
@@ -369,7 +369,13 @@
   class GitRelease < Release
     class << self
       def applies_to?
-        File.exist?('.git/config')
+        if File.exist? '.git/config'
+          true
+        else
+          File.expand_path(Dir.pwd) != '/' && Dir.chdir('..') do
+            applies_to?
+          end
+        end
       end
     end
 

Modified: buildr/trunk/spec/core/build_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/core/build_spec.rb?rev=797501&r1=797500&r2=797501&view=diff
==============================================================================
--- buildr/trunk/spec/core/build_spec.rb (original)
+++ buildr/trunk/spec/core/build_spec.rb Fri Jul 24 14:44:22 2009
@@ -340,7 +340,9 @@
     end
 
     it 'should return nil if no known release process' do
-      Release.find.should be_nil
+      Dir.chdir(Dir.tmpdir) do
+        Release.find.should be_nil
+      end
     end
 
     after :each do
@@ -507,7 +509,9 @@
 
   describe '#applies_to?' do
     it 'should reject a non-git repo' do
-      GitRelease.applies_to?.should be_false
+      Dir.chdir(Dir.tmpdir) do
+        GitRelease.applies_to?.should be_false
+      end
     end
 
     it 'should accept a git repo' do



Mime
View raw message