buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From boisv...@apache.org
Subject svn commit: r815907 - in /buildr/trunk: CHANGELOG lib/buildr/core/build.rb spec/core/build_spec.rb
Date Wed, 16 Sep 2009 17:46:37 GMT
Author: boisvert
Date: Wed Sep 16 17:46:36 2009
New Revision: 815907

URL: http://svn.apache.org/viewvc?rev=815907&view=rev
Log:
BUILDR-313: Prevent release with uncommitted_files on Git 1.4.3+

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

Modified: buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=815907&r1=815906&r2=815907&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Wed Sep 16 17:46:36 2009
@@ -1,4 +1,5 @@
 1.3.5 (Pending)
+* Fixed:  BUILDR-313: Prevent release with uncommitted_files on Git 1.4.3+ (Alexis Midon)
 * Fixed:  BUILDR-315: Fix Eclipse .classpath for local libraries (Mat Schaffer)
 * Added:  BUILDR-300: Make Eclipse task more configurable (Antoine Toulme, Alex Boisvert)
 * Fixed:  BUILDR-307 Failures are not reported correctly for ScalaTest (Jeremie Lenfant-Engelmann)

Modified: buildr/trunk/lib/buildr/core/build.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/build.rb?rev=815907&r1=815906&r2=815907&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/build.rb (original)
+++ buildr/trunk/lib/buildr/core/build.rb Wed Sep 16 17:46:36 2009
@@ -126,7 +126,7 @@
 
     # Returns list of uncommited/untracked files as reported by git status.
     def uncommitted_files
-      `git status`.scan(/^#\s{7}(\S.*)$/).map { |match| match.first.split.last }
+      `git status`.scan(/^#(\t|\s{7})(\S.*)$/).map { |match| match.last.split.last }
     end
 
     # Commit the given file with a message.

Modified: buildr/trunk/spec/core/build_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/core/build_spec.rb?rev=815907&r1=815906&r2=815907&view=diff
==============================================================================
--- buildr/trunk/spec/core/build_spec.rb (original)
+++ buildr/trunk/spec/core/build_spec.rb Wed Sep 16 17:46:36 2009
@@ -211,7 +211,7 @@
       Git.uncommitted_files.should be_empty
     end
 
-    it 'should reject a dirty repository' do
+    it 'should reject a dirty repository, Git 1.4.2 or former' do
       Git.should_receive(:`).with('git status').and_return <<-EOF
 # On branch master
 #
@@ -229,6 +229,24 @@
       EOF
       Git.uncommitted_files.should include('lib/buildr.rb', 'error.log')
     end
+
+    it 'should reject a dirty repository, Git 1.4.3 or higher' do
+      Git.should_receive(:`).with('git status').and_return <<-EOF
+# On branch master 
+# Changed but not updated:
+#   (use "git add <file>..." to update what will be committed)
+#
+#\tmodified:   lib/buildr.rb
+#\tmodified:   spec/buildr_spec.rb
+#
+# Untracked files:
+#   (use "git add <file>..." to include in what will be committed)
+#
+#\terror.log
+no changes added to commit (use "git add" and/or "git commit -a")
+      EOF
+      Git.uncommitted_files.should include('lib/buildr.rb', 'error.log')
+    end
   end
 
   describe '#remote' do



Mime
View raw message